[GHC] #14386: GHC doesn't allow Coercion between partly-saturated type constructors
GHC
ghc-devs at haskell.org
Wed Oct 25 02:16:45 UTC 2017
#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 Iceland_jack):
Replying to [comment:3 nomeata]:
> Interestingly, had you had
>
> {{{
> newtype NotOp cat a b = NotOp (cat b a)
> }}}
> then `:t Coercion :: Coercion (NotOp (NotOp cat)) cat` would work.
Did you mean
{{{#!hs
newtype NotOp cat a b = NotOp (cat a b)
}}}
> 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.
With quantified constraints, could we write?
{{{#!hs
type OpOp cat = forall xx yy. cat xx yy `Coercible` Op (Op cat) xx yy
wit :: OpOp cat => Op (Op cat) `Coercion` cat
wit = Coercion
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14386#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list