[GHC] #3217: Make GHCi have separate flags for interactive
Haskell expressions
GHC
trac at galois.com
Wed May 13 06:56:21 EDT 2009
#3217: Make GHCi have separate flags for interactive Haskell expressions
---------------------------------+------------------------------------------
Reporter: simonpj | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 6.12 branch
Component: Compiler | Version: 6.10.2
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by claus):
> > 4. While you're dealing with this, could you please remove the current
inconsistency that in-source flags are not propagated to the interactive
flags?
> What do you want to happen when there are multiple modules in scope at
the prompt? Take the union of the flags? What if they are contradictory?
According to [http://www.haskell.org/ghc/docs/latest/html/users_guide
/interactive-evaluation.html#ghci-scope]:
The syntax *module indicates that it is the full top-level scope of
module that is contributing to the scope for expressions typed at the
prompt. Without the *, just the exports of the module are visible. .. GHCi
combines the scopes from all of these modules to form the scope that is in
effect at the prompt.
Naively, I'd interpret that as meaning that the scopes are merged/unioned,
and that the scopes have to be compatible for this to succeed. I'd just
like this behaviour to be consistently applied to all of the module (if I
were to add both `Data.Map` and `Data.IntMap`, things like `empty` would
become ambiguous, so such contradictions aren't new).
If I'm *in* the top-level scope, the view from the prompt should be the
same as from within the module. If I'm trying to combine scopes that
couldn't possibly be part of a single module, I'd like to know (eg., I'd
be tempted to classify `:m +*Data.Map +*Data.IntMap` as an error, even if
the source are available, on the rationale that `:m +mod` means `import`
while `:m +*mod` means `include`).
Apart from in-source pragmas, GHCi also ignores `default` declarations,
which used to bite me when I was still using `default`. Given
{{{
import Data.Ratio
default (Ratio Int)
}}}
compare GHCi's
{{{
*Main> 1
1
}}}
with Hugs'
{{{
Main> 1
1 % 1
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3217#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list