I'd write it as

foo f = join .<$> sequence . (f <$>)

where
(.<$>) :: (.<$>) :: Functor f => (a -> b) -> ((x -> f a) -> (x -> f b))
x .<$> y = (x <$>) . y

is part of my line-noise toolbox.

This join .* sequence family of functions is quite common. 
Should really have a name for them.



Tony Morris-4 wrote:
> 
> Can (liftM join .) . mapM be improved?
> (Monad m) => (a -> m [b]) -> [a] -> m [b]
> 

-- 
View this message in context: 
http://old.nabble.com/%28liftM-join-.%29-.-mapM-tp26953786p26954040.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to