[GHC] #10715: Possible regression in Coercible a (X a) between 7.8 and 7.10

GHC ghc-devs at haskell.org
Fri Jul 31 12:33:33 UTC 2015


#10715: Possible regression in Coercible a (X a) between 7.8 and 7.10
-------------------------------------+-------------------------------------
        Reporter:  inaki             |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Replying to [comment:3 simonpj]:
 >  Maybe we should do the same for `Coercible`?

 The problem is that occurs-checks for representational equality don't
 necessarily mean failure. For example `a ~R b a` is solvable if `b`
 becomes the `Identity` newtype. However, I ''do'' think that `a ~R X a` is
 an error if `X` is known to be a datatype. (That is, generative w.r.t.
 representational equality.)

 But this will still fail:

 {{{
 oops :: Coercible a (b a) => a -> b a
 oops = coerce
 }}}

 Perhaps a way forward is to detect when an occurs-check problem has
 happened and add a `NB: The solver for Coercible constraints is
 incomplete` in the error? Not really sure what to do here, beyond making
 occurs-check a hard failure when there is a generative type somewhere.

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


More information about the ghc-tickets mailing list