Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
maybeAbort :: Exceptional e a -> Maybe e -> Exceptional e aexplicit-exception Control.Monad.Exception.Asynchronous.Lazy No documentation available.
maybeAbort :: Exceptional e a -> Maybe e -> Exceptional e aexplicit-exception Control.Monad.Exception.Asynchronous.Strict No documentation available.
-
rio RIO.Prelude The maybeToList function returns an empty list when given Nothing or a singleton list when given Just.
Examples
Basic usage:>>> maybeToList (Just 7) [7]
>>> maybeToList Nothing []
One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:>>> import GHC.Internal.Text.Read ( readMaybe ) >>> sum $ maybeToList (readMaybe "3") 3 >>> sum $ maybeToList (readMaybe "") 0
maybeH :: Monad m => Maybe v -> (v -> m ()) -> Maybe (m ()) -> m ()shakespeare Text.Hamlet Runs the second argument with the value in the first, if available. Otherwise, runs the third argument, if available.
-
errors Control.Error The maybeToList function returns an empty list when given Nothing or a singleton list when given Just.
Examples
Basic usage:>>> maybeToList (Just 7) [7]
>>> maybeToList Nothing []
One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:>>> import GHC.Internal.Text.Read ( readMaybe ) >>> sum $ maybeToList (readMaybe "3") 3 >>> sum $ maybeToList (readMaybe "") 0
maybeT :: Monad m => m b -> (a -> m b) -> MaybeT m a -> m berrors Control.Error.Util Case analysis for MaybeT Use the first argument if the MaybeT computation fails, otherwise apply the function to the successful result.
maybeEntropy :: MaybeEntropy d => d -> Maybe Doublestatistics Statistics.Distribution Returns the entropy of a distribution, in nats, if such is defined.
maybeMean :: MaybeMean d => d -> Maybe Doublestatistics Statistics.Distribution No documentation available.
maybeStdDev :: MaybeVariance d => d -> Maybe Doublestatistics Statistics.Distribution No documentation available.
maybeVariance :: MaybeVariance d => d -> Maybe Doublestatistics Statistics.Distribution No documentation available.