[GHC] #6018: Injective type families

GHC ghc-devs at haskell.org
Thu Sep 18 12:51:26 UTC 2014


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

Comment (by simonpj):

 The difficulty is that when you say
 {{{
    type family F (a::*) :: *
 }}}
 you expect `a` to be a ''type'' variable and `*` to be a ''kind''.  So if
 you say
 {{{
    type family F (a::*) :: (b :: *)
 }}}
 it looks as though `b` is a ''kind'' variable, and `*` is a ''sort''.
 That's why Reid wants to use `=` rather than `::`, and he is right.  It's
 reasonable to have either of these
 {{{
 type family F a :: *
 type family F a = (b :: *)
 }}}
 but not
 {{{
 type family F a :: (b :: *)
 }}}
 The merit of the "= blah" notation is that it allows us to give a name to
 the result, rather than use a magic name.  I think it's probably just
 about worth the syntactic cost.

 Simon

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


More information about the ghc-tickets mailing list