Hoogle Search

Within LTS Haskell 24.51 (ghc-9.10.3)

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

  1. parseMaybe :: (Ord e, Stream s) => Parsec e s a -> s -> Maybe a

    megaparsec Text.Megaparsec

    parseMaybe p input runs the parser p on input and returns the result inside Just on success and Nothing on failure. This function also parses eof, so if the parser doesn't consume all of its input, it will fail. The function is supposed to be useful for lightweight parsing, where error messages (and thus file names) are not important and entire input should be consumed. For example, it can be used for parsing of a single number according to a specification of its format.

  2. waitBarrierMaybe :: Barrier a -> IO (Maybe a)

    extra Control.Concurrent.Extra

    A version of waitBarrier that never blocks, returning Nothing if the barrier has not yet been signaled.

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

    extra Control.Monad.Extra

    Monadic generalisation of fromMaybe.

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

    extra Control.Monad.Extra

    A version of mapMaybe that works with a monadic predicate.

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

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

    extra Control.Monad.Extra

    Like whenMaybe, but where the test can be monadic.

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

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

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

    extra Extra

    Monadic generalisation of fromMaybe.

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

    extra Extra

    A version of mapMaybe that works with a monadic predicate.

Page 117 of many | Previous | Next