[GHC] #6018: Injective type families

GHC ghc-devs at haskell.org
Fri Oct 10 10:30:48 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 heisenbug):

 Replying to [comment:73 jstolarek]:
 > Simon, Richard, others,
 >
 > I'm making progress on this one but before going too far I want to get a
 green light on my design proposal (points 1-3). I've also bumped into some
 problems and have a couple of questions.
 >

 Just a side question. I have a type level Map:
 {{{
 type family Map (f :: k -> l) (ks :: [k]) :: [l] where
  ...
 }}}

 When I declare this as injective (presumably) with
 {{{
 type family Map (f :: k -> l) (ks :: [k]) = result :: [l] | result -> ks
 where
  ...
 }}}
 then `f` must be injective for this to work. Concretely, will this
 invocation be considered injective by GHC (`:set -XDataKinds`) ?
 {{{
 Map IO '[Int, (), Bool]
 }}}
 Thanks,

     Gabor

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


More information about the ghc-tickets mailing list