packages feed

rattletrap-11.0.0: 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