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.
parseMaybe :: (Ord e, Stream s) => Parsec e s a -> s -> Maybe amegaparsec 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.
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.
fromMaybeM :: Monad m => m a -> m (Maybe a) -> m aextra Control.Monad.Extra Monadic generalisation of fromMaybe.
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.