[GHC] #10833: Use injective type families when dealing with givens

GHC ghc-devs at haskell.org
Thu Sep 3 04:40:36 UTC 2015


#10833: Use injective type families when dealing with givens
-------------------------------------+-------------------------------------
              Reporter:  jstolarek   |             Owner:  jstolarek
                  Type:  feature     |            Status:  new
  request                            |
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.10.2
  (Type checker)                     |
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
             Test Case:              |        Blocked By:
              Blocking:              |   Related Tickets:  #6018
Differential Revisions:              |
-------------------------------------+-------------------------------------
 Consider this code:

 {{{#!hs
 type family Id a = r | r -> a

 id :: (Id a ~ Id b) => a -> b
 id x = x
 }}}
 GHC currently rejects it because it does not use type family injectivity
 information when dealing with the given constraints. Implementing this
 requires changing Core.

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


More information about the ghc-tickets mailing list