Re: [Haskell-cafe] Std lib equivalent for liftM concat . sequence

2008-05-18 Thread Yitzchak Gale
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.

Re: [Haskell-cafe] Std lib equivalent for liftM concat . sequence

2008-05-18 Thread Yitzchak Gale
Alistair Bayley wrote: >> A couple of days ago I had need for: >> concatM :: Monad m => [m [a]] -> m [a] >> concatM = liftM concat . sequence >> but found no such thing in the std libs It used to be in an older version of Haskell, but it was removed in Haskell 98. Bulat Ziganshin wrote: > 2. it's

Re: [Haskell-cafe] Std lib equivalent for liftM concat . sequence

2008-05-16 Thread Miguel Mitrofanov
Oops, I was very wrong. Sorry. On 16 May 2008, at 20:13, Miguel Mitrofanov wrote: Seems to be close to sequence :: [ListT m a] -> ListT m a Hmm? On 16 May 2008, at 14:12, Alistair Bayley wrote: A couple of days ago I had need for: concatM :: Monad m => [m [a]] -> m [a] concatM = liftM co

Re: [Haskell-cafe] Std lib equivalent for liftM concat . sequence

2008-05-16 Thread Miguel Mitrofanov
Seems to be close to sequence :: [ListT m a] -> ListT m a Hmm? On 16 May 2008, at 14:12, Alistair Bayley wrote: A couple of days ago I had need for: concatM :: Monad m => [m [a]] -> m [a] concatM = liftM concat . sequence but found no such thing in the std libs, except perhaps for msum (I

Re: [Haskell-cafe] Std lib equivalent for liftM concat . sequence

2008-05-16 Thread Bulat Ziganshin
Hello Alistair, Friday, May 16, 2008, 2:12:45 PM, you wrote: >> concatM = liftM concat . sequence > but found no such thing in the std libs, except perhaps for msum (I > don't want to add instances for MonadPlus. Should I have to?). Have I > missed something trivial? 1. it's easy to define your

[Haskell-cafe] Std lib equivalent for liftM concat . sequence

2008-05-16 Thread Alistair Bayley
A couple of days ago I had need for: > concatM :: Monad m => [m [a]] -> m [a] > concatM = liftM concat . sequence but found no such thing in the std libs, except perhaps for msum (I don't want to add instances for MonadPlus. Should I have to?). Have I missed something trivial? Alistair _