class (Monoid w, Monad m) => MonadWriter w m | m -> w where
pass :: m (a,w -> w) -> m a
listen :: m a -> m (a,w)
tell :: w -> m ()
What is the meaning of the pipe above? The snippet comes from here.
class (Monoid w, Monad m) => MonadWriter w m | m -> w where
pass :: m (a,w -> w) -> m a
listen :: m a -> m (a,w)
tell :: w -> m ()
What is the meaning of the pipe above? The snippet comes from here.
Actually, it's a "functional dependency". In this case that means that m
uniquely identifies w
-- the type of m
determines the type of w
. (This may be a better link.)