packages feed

rattletrap-14.1.4: src/lib/Rattletrap/Utility/Monad.hs

module Rattletrap.Utility.Monad where

whenMaybe :: (Applicative m) => Bool -> m a -> m (Maybe a)
whenMaybe p f = if p then fmap Just f else pure Nothing