logo       

RE: newtype and existentials: msg#00033

lang.haskell.glasgow.bugs

Subject: RE: newtype and existentials

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@xxxxxxxxxxxxxxxxxxxxxx]
| Sent: 18 November 2005 13:40
| To: Simon Peyton-Jones
| Cc: glasgow-haskell-bugs@xxxxxxxxxxx
| 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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise