Yitzchak Gale | 18 May 16:05

Re: Std lib equivalent for liftM concat . sequence

Alistair Bayley wrote:
>> concatM :: Monad m => [m [a]] -> m [a]
>> concatM = liftM concat . sequence

Miguel Mitrofanov wrote:
> Seems to be close to
> sequence :: [ListT m a] -> ListT m a
> Hmm?

Yes. It is close to something like that for the old
broken ListT - but let's not talk about that one.

For "ListT done right", how about:

concatM :: Monad m => [ListT m a] -> List m a
concatM = join . liftList

(http://www.haskell.org/haskellwiki/ListT_done_right)

Regards,
Yitz

Gmane