[GHC] #2178: GHC.Prim.Any replaces forall-bound type variables
in GHCi
GHC
trac at galois.com
Thu Mar 27 05:10:33 EDT 2008
#2178: GHC.Prim.Any replaces forall-bound type variables in GHCi
--------------------+-------------------------------------------------------
Reporter: japple | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: GHCi | Version: 6.8.2
Severity: normal | Resolution: invalid
Keywords: | Difficulty: Unknown
Testcase: | Architecture: x86
Os: Linux |
--------------------+-------------------------------------------------------
Changes (by simonpj):
* status: new => closed
* difficulty: => Unknown
* resolution: => invalid
Comment:
Looks fine to me. 'see' has type 'forall a,b. IO (a->b)'. You bind it,
so 'g' must have type 't1 -> t2' for some types 't1' and 't2'. There is no
generalisation in a bind, so GHC must choose some types for 't1' and
't2'... and it has.
It's essential for soundness that we don't generalise in a bind, otherwise
we'd get the ML polymorphic reference problem. If you say
{{{
r <- newIORef []
}}}
you do not want 'r :: forall a. IORef [a]'.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2178#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list