infinite types

blaat blaat l4t3r@hotmail.com
Wed, 16 Jul 2003 21:17:53 +0200


> > >  type R m = m -> Maybe (R m, [m])
> >
> > I don't think there's an extension of Haskell with regular type
> > unification.  It's certainly possible, but there's an equivalent in
> > standard Haskell:
> >
> >    newtype R m = MkR (m -> Maybe (R m, [m]))
>
>It will possibly be more convenient to break the cycle in another place, 
>where
>we will wrap and pattern match anyway:
>
>type R m = m -> Response m
>data Response m
>   | NotTaken
>   | Taken (R m) [m]

Thanks everyone for responding so swiftly. The trick by Marcin really 
cleaned up my code, thanks!

Cheers,
  l4t3r

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. 
http://join.msn.com/?page=features/junkmail