|
RE: newtype and existentials: msg#00030lang.haskell.glasgow.bugs
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: glasgow-haskell-bugs-bounces@xxxxxxxxxxx [mailto:glasgow-haskell-bugs- | bounces@xxxxxxxxxxx] On Behalf Of Ralf Hinze | Sent: 18 November 2005 13:28 | To: glasgow-haskell-bugs@xxxxxxxxxxx | 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 | Glasgow-haskell-bugs@xxxxxxxxxxx | http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | newtype and existentials, Ralf Hinze |
|---|---|
| Next by Date: | Re: newtype and existentials, Tomasz Zielonka |
| Previous by Thread: | Re: newtype and existentials, Tomasz Zielonka |
| Next by Thread: | Re: newtype and existentials, Ralf Hinze |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |