#1968: data family + GADT: not implemented yet
---------------------------------------------------+------------------------
    Reporter:  Remi                                |        Owner:  chak        
    
        Type:  bug                                 |       Status:  new         
    
    Priority:  normal                              |    Milestone:  6.10 branch 
    
   Component:  Compiler (Type checker)             |      Version:  6.9         
    
    Severity:  normal                              |   Resolution:              
    
    Keywords:  data type family GADT choose_univs  |   Difficulty:  Moderate (1 
day)
    Testcase:  GADT13                              |           Os:  
Unknown/Multiple
Architecture:  Unknown/Multiple                    |  
---------------------------------------------------+------------------------
Comment (by simonpj):

 Can we be more specific about what this ticket is about?  The HEAD (but
 not 6.10) does indeed accept GADT syntax for data type families.  (I
 implemented that a few months ago, but I think I forgot to tell anyone.)
 So the following program compiles fine; I believe it meets the hopes
 expressed by 'guest' and Wolfgang.
 {{{
 {-# LANGUAGE GADTs, TypeFamilies, KindSignatures #-}
 module Foo where

 data family Blah x :: * -> *

 data instance Blah Char a where
   Char1 :: Blah Char Int
   Char2 :: Blah Char Bool

 foo :: Blah Char a -> a
 foo Char1 = 2
 foo Char2 = False

 -------------------
 class C t where
     data D t :: * -> *

 instance C Bool where
     data D Bool a where
         A :: D Bool Int
         B :: D Bool Char
 }}}
 Does that do it?  Shall we close the ticket?  I've updated the docs to say
 explicitly that GADT syntax -- including actually defining a GADT as
 Wolfgang wants -- is allowed.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1968#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to