infinite types
Marcin 'Qrczak' Kowalczyk
qrczak@knm.org.pl
Wed, 16 Jul 2003 17:39:46 +0200
Dnia śro 16. lipca 2003 14:34, Ross Paterson napisał:
> > 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]
--
__("< Marcin Kowalczyk
\__/ qrczak@knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/