[GHC] #6018: Injective type families

GHC ghc-devs at haskell.org
Tue Sep 9 15:54:54 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:              |
-------------------------------------+-------------------------------------

Comment (by jstolarek):

 I think the bulk of the work with injectivity will be done under the hood.
 Changing the syntax later on will not be difficult and I don't want to be
 blocked by bikeshedding.

 Inferring injectivity for closed type families is something that indeed
 requires more discussion. But again, I feel I can make at least some
 progress without any binding decissions on this matter being made.

 I don't like any of Richard's proposals:

   - if we introduced `Result` this would be the first capitalized keyword
 (reserved word?) in Haskell. I don't like such inconsistency. Notice also
 that `result` might conflict with type variable names in type family head
 but that is a local conflict that restricts only the names possible to use
 for type variables. On the other hand `Result` might conflict with a name
 of a type (or type family), which is more of a global thing.
   - if we use syntax that uses type family name then we will get something
 like `type family F a b c | F b -> a c` and `F b` looks strange given that
 `F`'s arity is 3. It looks as if `F` could be partially applied.

 I don't think that restricting the use of `result` word in type family
 head is a big problem - we've already done that with `role`.

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


More information about the ghc-tickets mailing list