[GHC] #6018: Injective type families

GHC ghc-devs at haskell.org
Fri May 30 19:35:51 UTC 2014


#6018: Injective type families
-------------------------------+-------------------------------------------
        Reporter:  lunaris     |            Owner:  simonpj
            Type:  feature     |           Status:  new
  request                      |        Milestone:  7.10.1
        Priority:  normal      |          Version:  7.4.1
       Component:  Compiler    |         Keywords:  TypeFamilies, Injective
      Resolution:              |     Architecture:  Unknown/Multiple
Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple             |       Blocked By:
 Type of failure:              |  Related Tickets:  #4259
  None/Unknown                 |
       Test Case:              |
        Blocking:              |
-------------------------------+-------------------------------------------

Comment (by hpacheco):

 Is there a current version of the path that works against the current GHC
 HEAD? The 2-year-old one fails.

 I can say that I have been trying to define injective type families ever
 since TypeFamilies were introduced!
 Especially to define functions like the fmap that MikeIzbicki showed or
 very simple type-level aliases between different type classes.

 It also increases modularity. For example, to define the datatypes in
 different modules, and define an type family aliases in a parent module.


 {{{
 module A where

 data A = ...
 data FA = ...

 module B where

 data B = ...
 data FB = ...

 module Main where
 import A
 import B

 type family F a :: *
 type instance F A = FA
 type instance F A = FB
 }}}

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


More information about the ghc-tickets mailing list