Hoogle Search
Within LTS Haskell 24.32 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]extra Control.Monad.Extra A version of mapMaybe that works with a monadic predicate.
whenMaybe :: Applicative m => Bool -> m a -> m (Maybe a)extra Control.Monad.Extra 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)extra Control.Monad.Extra Like whenMaybe, but where the test can be monadic.
eitherToMaybe :: Either a b -> Maybe bextra Data.Either.Extra Given an Either, convert it to a Maybe, where Left becomes Nothing.
\x -> eitherToMaybe (Left x) == Nothing \x -> eitherToMaybe (Right x) == Just x
eitherToMaybe :: Either a b -> Maybe bextra Extra Given an Either, convert it to a Maybe, where Left becomes Nothing.
\x -> eitherToMaybe (Left x) == Nothing \x -> eitherToMaybe (Right x) == Just x
fromMaybeM :: Monad m => m a -> m (Maybe a) -> m aextra Extra Monadic generalisation of fromMaybe.
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]extra Extra A version of mapMaybe that works with a monadic predicate.
waitBarrierMaybe :: Barrier a -> IO (Maybe a)extra Extra A version of waitBarrier that never blocks, returning Nothing if the barrier has not yet been signaled.
whenMaybe :: Applicative m => Bool -> m a -> m (Maybe a)extra Extra 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)extra Extra Like whenMaybe, but where the test can be monadic.