[GHC] #6018: Injective type families

GHC ghc-devs at haskell.org
Tue Oct 21 21:29:52 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):

 Sure.  Take as long as you need.

 I was offering to do the type inference piece, which seemed to be the bit
 you are stalled on.  So if you do parser, renamer, and typechecking of the
 `TyCon` declaration, so we have the injectivity info in the `TyCon`, that
 would do it I think.

 In practical terms, a branch in a github repo that I can pull and push to
 would work well.

 All I plan to do is add a rule along the lines of
 {{{
   [W] F ty1 ~ rhs
   [W] F ty2 ~ rhs
 ===>  add a new constraint (if F is injective)
   [D] ty1 ~ ty2
 }}}
 very like functional dependencies for type classes.

 I'm not sure that there is time to get this implemented, tested etc before
 the 7.10 freeze, but we'll see.

 Simon

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


More information about the ghc-tickets mailing list