
14 Jan
2008
14 Jan
'08
9:54 p.m.
I wrote:
perhaps nowadays the type ought to be: concatMapM :: (Monad m, Traversable t) => (a -> m (t b)) -> t a -> m (t b)
apfelmus wrote:
I don't think that works in such generality since that would imply join :: Traversable t => t (t c) -> t c join = runIdentity . concatMapM return
Since return for the Identity monad is essential the identity, shouldn't we always have mapM return = return for that monad? In that case, your formula is indeed always true: runIdentity . concatMapM return = runIdentity . liftM join . mapM return = runIdentity . liftM join . return = runIdentity . return . join = join Regards, Yitz