Is join useful for every monad?
Henning Thielemann
lemming at henning-thielemann.de
Mon Oct 14 06:58:27 UTC 2019
On Mon, 14 Oct 2019, Georgi Lyubenov wrote:
> Other examples (subjectively of course) of such things are (<*>) which
> allows you to implement liftA{2,3,..} and mfix, which allows you to have
> recursive bindings in a do block.
Other example: We have
liftM2 :: (a -> b -> c) -> m a -> m b -> m c
but what can we do, if we need:
liftM2' :: (a -> b -> m c) -> m a -> m b -> m c
?
We could just do:
join $ liftM2 f ma mb
More information about the Libraries
mailing list