[GHC] #11424: "Occurs check" not considered when reducing closed type families

GHC ghc-devs at haskell.org
Fri Jan 15 21:53:08 UTC 2016


#11424: "Occurs check" not considered when reducing closed type families
-------------------------------------+-------------------------------------
        Reporter:  diatchki          |                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 goldfire):

 Replying to [comment:4 diatchki]:
 > If by `x` you mean a type variable, then I don't think there is any
 problem in reducing `Equals x x` to `True`.
 >
 > Otoh, if you encountered `Equals (F a) (F a)`, then you can still reduce
 that to `True`, but you'd also have to emit the constraint `F a ~ b`, to
 make sure that `F a` is well-defined.
 >

 But this doesn't support the substitution lemma. You say that we can
 reduce `Equals x x`. But what if we later learn that `x` is really `F a`?
 So if we're going to do the well-definedness check in the `F a` case, we
 have to delay reducing the `x` case.

 I agree with the other points in comment:4. Instead of a general well-
 formedness check, I'm asking the users to provide the name of a class that
 represents well-formedness.

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


More information about the ghc-tickets mailing list