Hoogle Search
Within LTS Haskell 24.49 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
dunai Control.Monad.Trans.MSF.Maybe Run the first msf until the second one produces True from the output of the first.
mapMaybeS :: forall (m :: Type -> Type) a b . Monad m => MSF m a b -> MSF m (Maybe a) (Maybe b)dunai Data.MonadicStreamFunction.Util Apply an MSF to every input. Freezes temporarily if the input is Nothing, and continues as soon as a Just is received.
-
eliminators Data.Eliminator No documentation available.
EMaybe :: ElmDatatype -> ElmPrimitiveelm-export Elm No documentation available.
eitherMaybe :: Either () a -> Maybe aerrors-ext Control.Error.Extensions Converts Either to Maybe. Specialization of either.
maybeEither . eitherMaybe = id
productMaybeWith :: (a -> b -> Maybe c) -> [[a]] -> [[b]] -> [[c]]extrapolate Test.Extrapolate Take the product of lists of tiers by a function returning a Maybe value discarding Nothing values.
productMaybeWith :: (a -> b -> Maybe c) -> [[a]] -> [[b]] -> [[c]]extrapolate Test.Extrapolate.Core Take the product of lists of tiers by a function returning a Maybe value discarding Nothing values.
mapMaybe :: (a -> Maybe b) -> FMList a -> FMList bfmlist Data.FMList No documentation available.
eitherToMaybe :: Either e a -> Maybe afrom-sum Control.FromSum Convert an Either to a Maybe. A Right value becomes Just.
>>> eitherToMaybe $ Right 3 Just 3
A Left value becomes Nothing.>>> eitherToMaybe $ Left "bye" Nothing
fromMaybe :: a -> Maybe a -> afrom-sum Control.FromSum The fromMaybe function takes a default value and a Maybe value. If the Maybe is Nothing, it returns the default value; otherwise, it returns the value contained in the Maybe.
Examples
Basic usage:>>> fromMaybe "" (Just "Hello, World!") "Hello, World!"
>>> fromMaybe "" Nothing ""
Read an integer from a string using readMaybe. If we fail to parse an integer, we want to return 0 by default:>>> import GHC.Internal.Text.Read ( readMaybe ) >>> fromMaybe 0 (readMaybe "5") 5 >>> fromMaybe 0 (readMaybe "") 0