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 :: forall (m :: Type -> Type) a b r . Monad m => (a -> Maybe b) -> Fold m b r -> Fold m a r

    streamly-core Streamly.Data.Fold

    mapMaybe f fold maps a Maybe returning function f on the input of the fold, filters out Nothing elements, and return the values extracted from Just.

    >>> mapMaybe f = Fold.lmap f . Fold.catMaybes
    
    >>> mapMaybe f = Fold.mapMaybeM (return . f)
    
    >>> f x = if even x then Just x else Nothing
    
    >>> fld = Fold.mapMaybe f Fold.toList
    
    >>> Stream.fold fld (Stream.enumerateFromTo 1 10)
    [2,4,6,8,10]
    

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

    streamly-core Streamly.Data.Stream

    Map a Maybe returning function to a stream, filter out the Nothing elements, and return a stream of values extracted from Just. Equivalent to:

    >>> mapMaybe f = Stream.catMaybes . fmap f
    

  3. mapMaybe :: forall (m :: Type -> Type) a b r . Monad m => (a -> Maybe b) -> Fold m b r -> Fold m a r

    streamly-core Streamly.Internal.Data.Fold

    mapMaybe f fold maps a Maybe returning function f on the input of the fold, filters out Nothing elements, and return the values extracted from Just.

    >>> mapMaybe f = Fold.lmap f . Fold.catMaybes
    
    >>> mapMaybe f = Fold.mapMaybeM (return . f)
    
    >>> f x = if even x then Just x else Nothing
    
    >>> fld = Fold.mapMaybe f Fold.toList
    
    >>> Stream.fold fld (Stream.enumerateFromTo 1 10)
    [2,4,6,8,10]
    

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

    streamly-core Streamly.Internal.Data.Stream

    Map a Maybe returning function to a stream, filter out the Nothing elements, and return a stream of values extracted from Just. Equivalent to:

    >>> mapMaybe f = Stream.catMaybes . fmap f
    

  5. mapMaybe :: forall a b (m :: Type -> Type) . (a -> Maybe b) -> StreamK m a -> StreamK m b

    streamly-core Streamly.Internal.Data.StreamK

    No documentation available.

  6. mapMaybe :: (Arrow arrow, Functor f) => (a -> Maybe b) -> arrow (f [a]) (f [b])

    synthesizer-midi Synthesizer.MIDI.CausalIO.Process

    No documentation available.

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

    vector-stream Data.Stream.Monadic

    No documentation available.

  8. mapMaybe :: (Ord k, Semigroup v) => (a -> Maybe b) -> AnnotatedMap k v a -> AnnotatedMap k v b

    what4 What4.Utils.AnnotatedMap

    No documentation available.

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

    Agda Agda.Utils.List1

    Like mapMaybe.

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

    hashmap Data.HashMap

    Map values and collect the Just results.

Page 10 of many | Previous | Next