Hoogle Search
Within LTS Haskell 24.38 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromMaybeM :: Monad m => m a -> m (Maybe a) -> m adistribution-opensuse OpenSuse.Prelude Monadic generalisation of fromMaybe.
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]distribution-opensuse OpenSuse.Prelude A version of mapMaybe that works with a monadic predicate.
whenMaybe :: Applicative m => Bool -> m a -> m (Maybe a)distribution-opensuse OpenSuse.Prelude Like when, but return either Nothing if the predicate was False, or Just with the result of the computation.
whenMaybe True (print 1) == fmap Just (print 1) whenMaybe False (print 1) == pure Nothing
whenMaybeM :: Monad m => m Bool -> m a -> m (Maybe a)distribution-opensuse OpenSuse.Prelude Like whenMaybe, but where the test can be monadic.
toMaybe :: Bool -> a -> Maybe adsp DSP.Basic generates a Just if the given condition holds
throwMaybe :: forall (m :: Type -> Type) e a . Monad m => MSF (ExceptT e m) (Maybe e) (Maybe a)dunai Control.Monad.Trans.MSF.Except When the input is Just e, throw the exception e. (Does not output any actual data.)
-
dunai Control.Monad.Trans.MSF.Maybe When an exception occurs in the first msf, the second msf is executed from there.
-
dunai Control.Monad.Trans.MSF.Maybe Convert exceptions into Nothing, discarding the exception value.
exceptToMaybeT :: forall (m :: Type -> Type) e a . Functor m => ExceptT e m a -> MaybeT m adunai Control.Monad.Trans.MSF.Maybe Convert a ExceptT computation to MaybeT, discarding the value of any exception.
hoistMaybe :: forall (m :: Type -> Type) b . Applicative m => Maybe b -> MaybeT m bdunai Control.Monad.Trans.MSF.Maybe