Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

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

  1. mapMaybe :: (v1 -> Maybe v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2

    insert-ordered-containers Data.HashMap.Strict.InsOrd

    No documentation available.

  2. mapMaybe :: forall (m :: Type -> Type) a b r . Monad m => (a -> Maybe b) -> Stream (Of a) m r -> Stream (Of b) m r

    streaming Streaming.Prelude

    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 Stream. If it is Just b, then b is included in the result Stream.

  3. mapMaybe :: Filterable f => (a -> Maybe b) -> f a -> f b

    witherable Witherable

    Like mapMaybe.

  4. mapMaybe :: Num time => (body0 -> Maybe body1) -> T time body0 -> T time body1

    event-list Data.EventList.Absolute.TimeBody

    No documentation available.

  5. mapMaybe :: Num time => (body0 -> Maybe body1) -> T time body0 -> T time body1

    event-list Data.EventList.Absolute.TimeTime

    No documentation available.

  6. mapMaybe :: C time => (body0 -> Maybe body1) -> T time body0 -> T time body1

    event-list Data.EventList.Relative.TimeBody

    No documentation available.

  7. mapMaybe :: C time => (body0 -> Maybe body1) -> T time body0 -> T time body1

    event-list Data.EventList.Relative.TimeTime

    No documentation available.

  8. mapMaybe :: (a -> Maybe b) -> EnumMap k a -> EnumMap k b

    enummapset Data.EnumMap.Lazy

    No documentation available.

  9. mapMaybe :: (a -> Maybe b) -> EnumMap k a -> EnumMap k b

    enummapset Data.EnumMap.Strict

    No documentation available.

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

    ghc-internal GHC.Internal.Data.Maybe

    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]
    

Page 5 of many | Previous | Next