Hoogle Search

Within LTS Haskell 24.25 (ghc-9.10.3)

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

  1. mapMaybe :: forall b a . (a -> Maybe b) -> Slist a -> Slist b

    slist Slist.Maybe

    The Maybe version of map which can throw out elements. If appliying the given function returns Nothing, no element is added on to the result list. If it is Just b, then b is included in the result list.

    >>> maybeEven x = if even x then Just x else Nothing
    
    >>> s = cons 1 $ cons 2 $ one 3
    
    >>> mapMaybe maybeEven s
    Slist {sList = [2], sSize = Size 1}
    
    If we map the Just constructor, the entire list should be returned:
    >>> mapMaybe Just s
    Slist {sList = [1,2,3], sSize = Size 3}
    

  2. mapM_ :: Monad m => (a -> m b) -> SerialT m a -> m ()

    streamly Streamly.Internal.Data.Stream.IsStream

    mapM_ = Stream.drain . Stream.mapM
    
    Apply a monadic action to each element of the stream and discard the output of the action. This is not really a pure transformation operation but a transformation followed by fold.

  3. mapMaybe :: forall t (m :: Type -> Type) a b . (IsStream t, Monad m) => (a -> Maybe b) -> t m a -> t m b

    streamly Streamly.Internal.Data.Stream.IsStream

    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.map fromJust . Stream.filter isJust . Stream.map f
    

  4. mapMaybeM :: (IsStream t, MonadAsync m, Functor (t m)) => (a -> m (Maybe b)) -> t m a -> t m b

    streamly Streamly.Internal.Data.Stream.IsStream

    Like mapMaybe but maps a monadic function. Equivalent to:

    mapMaybeM f = Stream.map fromJust . Stream.filter isJust . Stream.mapM f
    
    Concurrent (do not use with fromParallel on infinite streams)

  5. mapM_ :: Monad m => (a -> m b) -> SerialT m a -> m ()

    streamly Streamly.Prelude

    mapM_ = Stream.drain . Stream.mapM
    
    Apply a monadic action to each element of the stream and discard the output of the action. This is not really a pure transformation operation but a transformation followed by fold.

  6. mapMaybe :: forall t (m :: Type -> Type) a b . (IsStream t, Monad m) => (a -> Maybe b) -> t m a -> t m b

    streamly Streamly.Prelude

    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.map fromJust . Stream.filter isJust . Stream.map f
    

  7. mapMaybeM :: (IsStream t, MonadAsync m, Functor (t m)) => (a -> m (Maybe b)) -> t m a -> t m b

    streamly Streamly.Prelude

    Like mapMaybe but maps a monadic function. Equivalent to:

    mapMaybeM f = Stream.map fromJust . Stream.filter isJust . Stream.mapM f
    
    Concurrent (do not use with fromParallel on infinite streams)

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

    strict-base-types Data.Maybe.Strict

    Analogous to mapMaybe in Data.Maybe.

  9. mapM_ :: (Monad m, Unboxable a) => (a -> m b) -> Vector a -> m ()

    unboxing-vector Data.Vector.Unboxing

    No documentation available.

  10. mapMaybe :: (Unboxable a, Unboxable b) => (a -> Maybe b) -> Vector a -> Vector b

    unboxing-vector Data.Vector.Unboxing

    No documentation available.

Page 58 of many | Previous | Next