Opened 3 years ago

Closed 3 years ago

#8878 closed feature request (fixed)

Export runTcInteractive from TcRnDriver

Reported by: holzensp Owned by: holzensp
Priority: lowest Milestone: 7.8.1
Component: Compiler Version: 7.8.1-rc2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


For people writing more involved code onto GHC than the normal API (GHC.hs) allows, this is a very useful function. In previous versions of GHC, it has always been unclear to me how I should run the type checker on, for example, a single expression, while keeping the context (i.e. when running the type checker again, the types derived in the former run should still be known in the latter). Simply having runTcInteractive exported does wonders for self-documentation purposes.

(patch to follow shortly)

Attachments (1)

0001-Implementation-of-8878.patch (721 bytes) - added by holzensp 3 years ago.
Implementation of feature request

Download all attachments as: .zip

Change History (8)

comment:1 Changed 3 years ago by holzensp

Owner: set to holzensp

Changed 3 years ago by holzensp

Implementation of feature request

comment:2 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

In 60bbc0af79ddfe977d93e271b57c2bc25d3fcde6/ghc:

Export runTcInteractive from TcRnDriver, and from GHC (Trac #8878)

comment:3 Changed 3 years ago by simonpj

OK I've done this, and also exported it from module GHC, which is supposed to be the API that clients use.

Is it important to merge this into 7.8? It is very late in the day, but its a very innocuous change.


comment:4 Changed 3 years ago by thoughtpolice

Status: newmerge

A minor API addition like this isn't really a big deal IMO. It can go in the queue.

comment:5 Changed 3 years ago by holzensp

I didn't include the export in GHC, because of Simon M's argument on the mailing list [1] that GHC doesn't export TcRn, which is required for runTcInteractive. I'm fine with it either way, though.

Methinks it is a rather harmless change, so I see no issue with including it in 7.8 as you have now done. Thanks much ;)


comment:6 Changed 3 years ago by simonpj

I don't really care either, but my inclination is that if it's something we expect GHC-API clients to call, it should be exported by GHC.

You want runTcInterative, but presumably to make use of it you also need some other functions in the TcRn monad. So probably it alone isn't enough. Identifying a useful set would be a Good Thing.


comment:7 Changed 3 years ago by thoughtpolice

Resolution: fixed
Status: mergeclosed

Merged in 7.8.

Note: See TracTickets for help on using tickets.