[GHC] #9112: data families with representational matching

GHC ghc-devs at haskell.org
Thu May 15 02:57:18 UTC 2014


#9112: data families with representational matching
------------------------------------+-------------------------------------
       Reporter:  jwlato            |             Owner:
           Type:  feature request   |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.8.2
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 Since ghc-7.8, the following is no longer possible:

 {{{
 -- simplified example taken from the vector package
 class MVectorClass (v :: * -> * -> *) a where
     basicLength :: v s a -> Int

 data family MVector s a

 data instance MVector s Int -- implementation not important

 newtype Age = Age Int deriving (MVectorClass MVector) -- rejected
 }}}

 Following from discussion in #8177, to enable this ghc would need to
 support data families with representational matching, such that `MVector s
 Int` and `MVector s Age` are representationally equal.

 This has broken some code that previously worked, however as there are
 some workarounds I'm not sure how important it is.

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


More information about the ghc-tickets mailing list