Hoogle Search

Within LTS Haskell 24.39 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. data AndMaybe a b

    yaya Yaya.Pattern

    Isomorphic to (a, Maybe b), it’s also the pattern functor for non-empty lists.

  2. andMaybe :: (a -> c) -> (a -> b -> c) -> AndMaybe a b -> c

    yaya Yaya.Pattern

    Eliminator for AndMaybe, akin to either or maybe.

  3. bindFromMaybeCharToIntPair :: Parser s e (# (# #) | Char# #) -> ((# (# #) | Char# #) -> Parser s e (# Int#, Int# #)) -> Parser s e (# Int#, Int# #)

    bytesmith Data.Bytes.Parser

    No documentation available.

  4. bindFromMaybeCharToLifted :: Parser s e (# (# #) | Char# #) -> ((# (# #) | Char# #) -> Parser s e a) -> Parser s e a

    bytesmith Data.Bytes.Parser

    No documentation available.

  5. parseBytesMaybe :: (forall s . () => Parser e s a) -> Bytes -> Maybe a

    bytesmith Data.Bytes.Parser

    Variant of parseBytesEither that discards the error message on failure. Just like parseBytesEither, this does not impose any checks on the length of the remaining input.

  6. type SourceRepoMaybe = SourceRepositoryPackage Maybe

    cabal-install-parsers Cabal.SourceRepo

    Distilled from SourceRepo

  7. catMaybes :: (Contiguous arr, Element arr a, Element arr (Maybe a)) => arr (Maybe a) -> arr a

    contiguous Data.Primitive.Contiguous

    The catMaybes function takes a list of Maybes and returns a list of all the Just values.

  8. mapMaybe :: forall arr1 arr2 a b . (Contiguous arr1, Element arr1 a, Contiguous arr2, Element arr2 b) => (a -> Maybe b) -> arr1 a -> arr2 b

    contiguous Data.Primitive.Contiguous

    The mapMaybe function is a version of map which can throw out elements. In particular, the functional arguments returns something of type Maybe b. If this is Nothing, no element is added on to the result array. If it is Just b, then b is included in the result array.

  9. mapMaybe :: Ord k => (a -> Maybe b) -> Map k a -> Map k b

    dhall Dhall.Map

    Transform all values in a Map using the supplied function, deleting the key if the function returns Nothing

    >>> mapMaybe Data.Maybe.listToMaybe (fromList [("C",[1]),("B",[]),("A",[3])])
    fromList [("C",1),("A",3)]
    

  10. catMaybes :: [Maybe a] -> [a]

    foundation Foundation

    The catMaybes function takes a list of Maybes and returns a list of all the Just values.

    Examples

    Basic usage:
    >>> catMaybes [Just 1, Nothing, Just 3]
    [1,3]
    
    When constructing a list of Maybe values, catMaybes can be used to return all of the "success" results (if the list is the result of a map, then mapMaybe would be more appropriate):
    >>> import GHC.Internal.Text.Read ( readMaybe )
    
    >>> [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ]
    [Just 1,Nothing,Just 3]
    
    >>> catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ]
    [1,3]
    

Page 218 of many | Previous | Next