#4009: can newtype be extended to permit GADT-like declarations
--------------------------------+-------------------------------------------
    Reporter:  nr               |       Owner:                         
        Type:  feature request  |      Status:  new                    
    Priority:  normal           |   Component:  Compiler (Type checker)
     Version:  6.12.1           |    Keywords:  newtype GADT           
          Os:  Linux            |    Testcase:                         
Architecture:  x86              |     Failure:  None/Unknown           
       Patch:  0                |  
--------------------------------+-------------------------------------------
 I'd like to create the following value constructor without the overhead of
 {{{data}}}:
 {{{
 data B n e x where
   B :: Body n -> B n C C
 }}}
 However, if I ask for {{{newtype}}} instead of {{{data}}} I'm told that a
 newtype constructor must have a return type of form {{{T a1 ... an}}}.  Is
 this restriction fundamental?  If not, could it be possible to allow GADT-
 like declarations for {{{newtype}}}?

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4009>
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