Skip to content

ghci Foo.hs should load the Foo.hs file interpreted

ghc Foo.hs, where Foo.hs has a name X that is not exported. ghci Foo.hs Asking for the type of X now fails, since X is not in scope.

I would like to have that the latter operation does not fail. When one asks for the Foo.hs file, the Foo.hs file should be loaded interpreted. When one asks for the Foo module, the same should happen. When one explicitly asks for Foo.o or Foo.hi, the compiled version should be loaded.

The rationale for all this is that ghci is used to explore code. In the rare case that one for example compiles somebody else's project and want to look around a bit (ask for types for example), one does not want to touch(1) every file by hand first.

Trac metadata
Trac field Value
Version 6.7
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information