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.

  1. mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]

    extra Control.Monad.Extra

    A version of mapMaybe that works with a monadic predicate.

  2. 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
    

  3. whenMaybeM :: Monad m => m Bool -> m a -> m (Maybe a)

    extra Control.Monad.Extra

    Like whenMaybe, but where the test can be monadic.

  4. eitherToMaybe :: Either a b -> Maybe b

    extra 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
    

  5. eitherToMaybe :: Either a b -> Maybe b

    extra Extra

    Given an Either, convert it to a Maybe, where Left becomes Nothing.

    \x -> eitherToMaybe (Left x) == Nothing
    \x -> eitherToMaybe (Right x) == Just x
    

  6. fromMaybeM :: Monad m => m a -> m (Maybe a) -> m a

    extra Extra

    Monadic generalisation of fromMaybe.

  7. mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]

    extra Extra

    A version of mapMaybe that works with a monadic predicate.

  8. 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.

  9. 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
    

  10. whenMaybeM :: Monad m => m Bool -> m a -> m (Maybe a)

    extra Extra

    Like whenMaybe, but where the test can be monadic.

Page 113 of many | Previous | Next