Hoogle Search

Within LTS Haskell 24.20 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

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

    extra Control.Monad.Extra

    Like findM, but also allows you to compute some additional information in the predicate.

  2. untilJustM :: Monad m => m (Maybe a) -> m a

    extra Control.Monad.Extra

    Keep running an operation until it becomes a Just, then return the value inside the Just as the result of the overall loop.

  3. whenJust :: Applicative m => Maybe a -> (a -> m ()) -> m ()

    extra Control.Monad.Extra

    Perform some operation on Just, given the field inside the Just. This is a specialized for_.

    whenJust Nothing  print == pure ()
    whenJust (Just 1) print == print 1
    

  4. whenJustM :: Monad m => m (Maybe a) -> (a -> m ()) -> m ()

    extra Control.Monad.Extra

    Like whenJust, but where the test can be monadic.

  5. whileJustM :: (Monad m, Monoid a) => m (Maybe a) -> m a

    extra Control.Monad.Extra

    Keep running an operation until it becomes a Nothing, accumulating the monoid results inside the Justs as the result of the overall loop.

  6. firstJustM :: (Foldable f, Monad m) => (a -> m (Maybe b)) -> f a -> m (Maybe b)

    extra Data.Foldable.Extra

    A generalization of firstJustM to Foldable instances.

  7. firstJust :: (a -> Maybe b) -> [a] -> Maybe b

    extra Data.List.Extra

    Find the first element of a list for which the operation returns Just, along with the result of the operation. Like find but useful where the function also computes some expensive information that can be reused. Particular useful when the function is monadic, see firstJustM.

    firstJust id [Nothing,Just 3]  == Just 3
    firstJust id [Nothing,Nothing] == Nothing
    

  8. catchJust_ :: (SomeException -> Maybe b) -> IO a -> (b -> IO a) -> IO a

    extra Extra

    Like catch_ but for catchJust

  9. firstJust :: (a -> Maybe b) -> [a] -> Maybe b

    extra Extra

    Find the first element of a list for which the operation returns Just, along with the result of the operation. Like find but useful where the function also computes some expensive information that can be reused. Particular useful when the function is monadic, see firstJustM.

    firstJust id [Nothing,Just 3]  == Just 3
    firstJust id [Nothing,Nothing] == Nothing
    

  10. firstJustM :: Monad m => (a -> m (Maybe b)) -> [a] -> m (Maybe b)

    extra Extra

    Like findM, but also allows you to compute some additional information in the predicate.

Page 32 of many | Previous | Next