
#14386: GHC doesn't allow Coercion between partly-saturated type constructors -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.3 Resolution: | Keywords: roles 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 nomeata): No, it would not be wrong. We just don't have the machinery yet. Interestingly, had you had {{{ newtype NotOp cat a b = NotOp (cat b a) }}} then `:t Coercion :: Coercion (NotOp (NotOp cat)) cat` would work. Why? Because the axiom you get out of a `newtype` is eta-contracted as far as possible; in this case. {{{ NotOp cat ~ cat }}} The thing with `Either` is a completely different story. Note that you are coercing _an argument of `Either`_ (still `Either` on both sides) whereas originally you are coercing between `Op` and it’s representation. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14386#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler