[GHC] #12373: Type error but types match

GHC ghc-devs at haskell.org
Thu Jul 7 11:10:41 UTC 2016


#12373: Type error but types match
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |
      Resolution:                    |             Keywords:
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):

 The error message is dire, but the error is real.
 {{{
 -- Type of data constructor for IO:
 IO :: forall a. State# RealWorld -> (# State# RealWorld, a #)

 -- Type of newMVar#
 newMVar# :: forall b. State# s -> (# State# s, MVar# s b #)
 }}}
 So when we apply `IO` to `newMVar#` we have to instantiate the `forall a`
 with `MVar# s b` which isn't allowed.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12373#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list