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. maybeToLeft :: b -> Maybe a -> Either a b

    either Data.Either.Combinators

    Maybe produce a Left, otherwise produce a Right.

    >>> maybeToLeft "default" (Just 12)
    Left 12
    
    >>> maybeToLeft "default" Nothing
    Right "default"
    

  2. maybeToRight :: b -> Maybe a -> Either b a

    either Data.Either.Combinators

    Maybe produce a Right, otherwise produce a Left.

    >>> maybeToRight "default" (Just 12)
    Right 12
    
    >>> maybeToRight "default" Nothing
    Left "default"
    

  3. maybeAbort :: Exceptional e a -> Maybe e -> Exceptional e a

    explicit-exception Control.Monad.Exception.Asynchronous.Lazy

    No documentation available.

  4. maybeAbort :: Exceptional e a -> Maybe e -> Exceptional e a

    explicit-exception Control.Monad.Exception.Asynchronous.Strict

    No documentation available.

  5. maybeToList :: Maybe a -> [a]

    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
    

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

  7. maybeToList :: Maybe a -> [a]

    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
    

  8. maybeT :: Monad m => m b -> (a -> m b) -> MaybeT m a -> m b

    errors Control.Error.Util

    Case analysis for MaybeT Use the first argument if the MaybeT computation fails, otherwise apply the function to the successful result.

  9. maybeEntropy :: MaybeEntropy d => d -> Maybe Double

    statistics Statistics.Distribution

    Returns the entropy of a distribution, in nats, if such is defined.

  10. maybeMean :: MaybeMean d => d -> Maybe Double

    statistics Statistics.Distribution

    No documentation available.

Page 38 of many | Previous | Next