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

    rebase Rebase.Prelude

    Maybe produce a Left, otherwise produce a Right.

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

  3. maybeToLeft :: r -> Maybe l -> Either l r

    relude Relude.Monad.Either

    Maps Maybe to Either wrapping default value into Right.

    >>> maybeToLeft True (Just "aba")
    Left "aba"
    
    >>> maybeToLeft True Nothing
    Right True
    

  4. maybeToLeft :: r -> Maybe l -> Either l r

    protolude Protolude.Either

    No documentation available.

  5. maybeToLeft :: r -> Maybe l -> Either l r

    incipit-base Incipit.Either

    Turn Just into Left and Nothing into Right with the supplied value.

Page 1 of 1