newtype and existentials

Simon Peyton-Jones simonpj at microsoft.com
Fri Nov 18 08:43:14 EST 2005


maybe so.  GHC does indeed treat recursive newtypes specially.  But I don't like that; it's a wart in the intermediate language.  But it's a wart I'd like to shrink, not grow.

S

| -----Original Message-----
| From: Ralf Hinze [mailto:ralf at informatik.uni-bonn.de]
| Sent: 18 November 2005 13:40
| To: Simon Peyton-Jones
| Cc: glasgow-haskell-bugs at haskell.org
| Subject: Re: newtype and existentials
| 
| > 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.
| 
| Following your reasoning, shouldn't GHC also reject
| 
| > newtype D = D (D -> D)
| 
| because there is no existing Haskell type isomorphic to D? And
| certainly, System F doesn't have recursive types either.
| 
| Cheers, Ralf



More information about the Glasgow-haskell-bugs mailing list