Which one makes more sense for you and why?

whenJust :: Applicative f => Maybe a -> (a -> f ()) -> f ()


whenJust :: (Applicative f, Monoid m) => Maybe a -> (a -> f m) -> f m


whenJust :: Monoid m => Maybe a -> (a -> m) -> m


@pureevil I like the second one more.

It captures the semantics (I think) you want, while retaining the most flexibility.

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.