[Haskell-cafe] Re: IO in lists
Dan Piponi
dpiponi at gmail.com
Tue Jan 23 14:09:15 EST 2007
Yitzchak,
> Hmm, I thought it was the old one...
No, definitely the new one. The old one is:
newtype ListT m a = ListT { runListT :: m [a] }
which treats the entire list as one uninterleavable lump.
The new one is:
data MList' m a = MNil | a `MCons` MList m a
type MList m a = m (MList' m a)
newtype ListT m a = ListT { runListT :: MList m a }
Note the definition of MList' is isomorphic to a use of Maybe.
--
Dan
More information about the Haskell-Cafe
mailing list