[Haskell-cafe] Re: IO in lists

Yitzchak Gale gale at sefer.org
Tue Jan 23 18:35:31 EST 2007

Dan Piponi wrote:
> 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.

Yes, and in fact


uses exactly your type.

But the old broken ListT happens to work fine here.
See my earlier post in this thread.


More information about the Haskell-Cafe mailing list