yes.  a newtype declares a new type isomorphic to an existing type.  
        newtype T = MkT S
declares T to be isomorphic to S.

There is no existing Haskell type isomorphic to your Dynamic.

In concrete terms, the newtype constructor is discarded before we get to
System F; but we can't do that with an existential.

S

| -----Original Message-----
| From: [EMAIL PROTECTED]
[mailto:glasgow-haskell-bugs-
| [EMAIL PROTECTED] On Behalf Of Ralf Hinze
| Sent: 18 November 2005 13:28
| To: [email protected]
| Subject: newtype and existentials
| 
| Is there a strong reason why
| 
| > {-# OPTIONS -fglasgow-exts #-}
| > data Type :: (* -> *) where
| >   Int   ::  Type Int
| > data Dynamic  =  forall a . Dyn (a, Type a)
| 
| works, but not
| 
| > newtype Dynamic  =  forall a . Dyn (a, Type a)
| 
| Cheers, Ralf
| _______________________________________________
| Glasgow-haskell-bugs mailing list
| [email protected]
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to