[GHC] #6018: Injective type families

GHC ghc-devs at haskell.org
Fri Sep 30 19:46:05 UTC 2016


#6018: Injective type families
-------------------------------------+-------------------------------------
        Reporter:  lunaris           |                Owner:  jstolarek
            Type:  feature request   |               Status:  closed
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  7.4.1
      Resolution:  fixed             |             Keywords:  TypeFamilies,
                                     |  Injective
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:  T6018,
                                     |  T6018fail, T6018rnfail, T6018th,
                                     |  T6018failclosed1, T6018failclosed2,
                                     |  T6018ghci, T6018ghcifail,
                                     |  T6018ghcirnfail
      Blocked By:                    |             Blocking:
 Related Tickets:  #4259, #10832,    |  Differential Rev(s):  Phab:D202
  #10833                             |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 Use case of more complicated injectivity annotations from
 [http://www.diku.dk/~paba/pubs/files/serrano15haskell-paper.pdf Type
 Families with Class, Type Classes with Family], simulating the type class:

 {{{#!hs
 class Collection c e | c -> e where
   empty :: c
   add   :: e -> c -> c
 }}}

 with a type family

 {{{#!hs
 data Defined = Yes | No

 type family IsCollection t e = (result :: Defined) | result t -> e
 }}}

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


More information about the ghc-tickets mailing list