[GHC] #11152: GND accepts ill-roled coercion when manually defining it won't typecheck

GHC ghc-devs at haskell.org
Tue Dec 1 18:37:04 UTC 2015


#11152: GND accepts ill-roled coercion when manually defining it won't typecheck
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.10.2
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 Don't think there is a bug here. The GND is okay because `MyMaybe` is
 known to have a type parameter of representational role. The problem
 arises with types involving a variable monad, since we cannot or do not
 want to require all monads be representational.

 Your manual implementation is wrong because `a` does not refer to the type
 you want it to (compare `myid :: a -> a; myid x = x :: a`).

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


More information about the ghc-tickets mailing list