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.

  1. maybeTagText :: Tag str -> Maybe str

    tagsoup Text.HTML.TagSoup

    Extract the string from within TagText, otherwise Nothing

  2. maybeTagWarning :: Tag str -> Maybe str

    tagsoup Text.HTML.TagSoup

    Extract the string from within TagWarning, otherwise Nothing

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

    strict Data.Strict.Maybe

    Analogous to maybeToList in Data.Maybe.

  4. maybeCodec :: ValueCodec input output -> ValueCodec (Maybe input) (Maybe output)

    autodocodec Autodocodec

    Maybe codec This can be used to also allow null during decoding of a Maybe value. During decoding, also accept a null value as Nothing. During encoding, encode as usual.

    Example usage

    >>> toJSONVia (maybeCodec codec) (Just 'a')
    String "a"
    
    >>> toJSONVia (maybeCodec codec) (Nothing :: Maybe Char)
    Null
    

  5. maybeCodec :: ValueCodec input output -> ValueCodec (Maybe input) (Maybe output)

    autodocodec Autodocodec.Codec

    Maybe codec This can be used to also allow null during decoding of a Maybe value. During decoding, also accept a null value as Nothing. During encoding, encode as usual.

    Example usage

    >>> toJSONVia (maybeCodec codec) (Just 'a')
    String "a"
    
    >>> toJSONVia (maybeCodec codec) (Nothing :: Maybe Char)
    Null
    

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

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

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

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

    No documentation available.

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

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

    No documentation available.

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

Page 37 of many | Previous | Next