
#14391: Make the simplifier independent of the typechecker -------------------------------------+------------------------------------- Reporter: nomeata | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj):
importDecl has IfM in its type. And IfM is defined in TcRnTypes, so leaving it doesn't bring us decoupling from the typechecker. Should we also replace importDecl?
No, leave all that. The point is as follows (please document this in your patch): * `TcEnv.lookupGlobal` may look up an `Id` that one one has previously looked up. * If so, we are going to read its interface file, and add its bindings to the `ExternalPackageTable`, which is a persistent in-memory cache of information about other modules. * Loading that interface file does quite a bit of work, but we don't consider that as "part of the typechecker"; it's essentially just de- serialising interface-file data on disk. For example, any failures are not user errors; they represent messed-up files or GHC bugs, so can legitimatelly raise an exception. * The entire mechanism of `importDecl` and `loadInterface` is part of this. Don't duplicate it! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14391#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler