Make GHCi have separate flags for interactive Haskell expressions
It's becoming clear that in GHCi we want to have a separate set of command-line flags for
- Compiling Haskell expressions typed at the GHCi prompt
- Compiling entire modules, eg via
:load
Examples of this need are:
- We already have an ad-hoc difference in the way that type-class defaults are applied: http://www.haskell.org/ghc/docs/latest/html/users_guide/interactive-evaluation.html\#extended-default-rules
- In #3202 (closed) there's a well-argued request to change behaviour of the monomorphism restriction
So the new feature would consist of:
- The
InteractiveContext
should contain a set ofDynFlags
used for compiling command-line Haskell expressions (the interactiveDynFlags
) - The
:set
command would change both theDynFlags
maintained by GHCi for compiling entire modules (the batchDynFlags
), and the interactiveDynFlags
. - A new
:seti
command to change the interactive flags - Just possibly a
:setb
command to set the batch flags but leave the interactive ones unchanged.
Arguably it'd be good to have a command to display the current flag settings (of either DynFlags
) but that's another blob of work.
Trac metadata
Trac field | Value |
---|---|
Version | 6.10.2 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |