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. mapMaybe :: Ord b => (a -> Maybe b) -> MaxQueue a -> MaxQueue b

    pqueue Data.PQueue.Max

    Maps a function over the elements of the queue, and collects the Just values.

  2. mapMaybe :: Ord b => (a -> Maybe b) -> MinQueue a -> MinQueue b

    pqueue Data.PQueue.Min

    Map elements and collect the Just results.

  3. mapMaybe :: Ord k => (a -> Maybe b) -> MaxPQueue k a -> MaxPQueue k b

    pqueue Data.PQueue.Prio.Max

    Map values and collect the Just results.

  4. mapMaybe :: Ord k => (a -> Maybe b) -> MinPQueue k a -> MinPQueue k b

    pqueue Data.PQueue.Prio.Min

    Map values and collect the Just results.

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

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

  7. mapMaybe :: (a -> Maybe b) -> [a] -> [b]

    foundation Foundation

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

    Examples

    Using mapMaybe f x is a shortcut for catMaybes $ map f x in most cases:
    >>> import GHC.Internal.Text.Read ( readMaybe )
    
    >>> let readMaybeInt = readMaybe :: String -> Maybe Int
    
    >>> mapMaybe readMaybeInt ["1", "Foo", "3"]
    [1,3]
    
    >>> catMaybes $ map readMaybeInt ["1", "Foo", "3"]
    [1,3]
    
    If we map the Just constructor, the entire list should be returned:
    >>> mapMaybe Just [1,2,3]
    [1,2,3]
    

  8. mapMaybe :: (a -> Maybe b) -> MonoidalIntMap a -> MonoidalIntMap b

    monoidal-containers Data.IntMap.Monoidal

    No documentation available.

  9. mapMaybe :: (a -> Maybe b) -> MonoidalIntMap a -> MonoidalIntMap b

    monoidal-containers Data.IntMap.Monoidal.Strict

    No documentation available.

  10. mapMaybe :: forall k a b . (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b

    monoidal-containers Data.Map.Monoidal

    No documentation available.

Page 7 of many | Previous | Next