8 Mar
2006
8 Mar
'06
1:09 p.m.
On 3/7/06, Ben Rudiak-Gould <Benjamin.Rudiak-Gould@cl.cam.ac.uk> wrote: # John Meacham wrote: # # Polymorphic recursion allows the construction of infinite types if I # # understand what you mean. # # No, that's different. An infinite type can't be written in (legal) Haskell. Though GHC with existentials allows something infinite looking (and not just because I named it "Inf" :-)):
{-# OPTIONS -fglasgow-exts #-}
data Zero = Zero data Succ n = Succ n
-- Error: infinite type! -- x = Succ x
data Inf = forall n . Inf n y = Inf (Succ y)
Jim