Hoogle Search

Within LTS Haskell 24.3 (ghc-9.10.2)

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

  1. concatMap :: Foldable t => (a -> [b]) -> t a -> [b]

    dimensional Numeric.Units.Dimensional.Prelude

    Map a function over all the elements of a container and concatenate the resulting lists.

    Examples

    Basic usage:
    >>> concatMap (take 3) [[1..], [10..], [100..], [1000..]]
    [1,2,3,10,11,12,100,101,102,1000,1001,1002]
    
    >>> concatMap (take 3) (Just [1..])
    [1,2,3]
    

  2. concatForM :: Monad m => [a] -> (a -> m [b]) -> m [b]

    distribution-opensuse OpenSuse.Prelude

    Like concatMapM, but has its arguments flipped, so can be used instead of the common fmap concat $ forM pattern.

  3. concatMap :: Foldable t => (a -> [b]) -> t a -> [b]

    distribution-opensuse OpenSuse.Prelude

    Map a function over all the elements of a container and concatenate the resulting lists.

    Examples

    Basic usage:
    >>> concatMap (take 3) [[1..], [10..], [100..], [1000..]]
    [1,2,3,10,11,12,100,101,102,1000,1001,1002]
    
    >>> concatMap (take 3) (Just [1..])
    [1,2,3]
    

  4. concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]

    distribution-opensuse OpenSuse.Prelude

    A version of concatMap that works with a monadic predicate.

  5. concatFoldableWith :: forall t f (m :: Type -> Type) a . (IsStream t, Foldable f) => (t m a -> t m a -> t m a) -> f (t m a) -> t m a

    streamly Streamly.Prelude

    A variant of fold that allows you to fold a Foldable container of streams using the specified stream sum operation.

    concatFoldableWith async $ map return [1..3]
    
    Equivalent to:
    concatFoldableWith f = Prelude.foldr f D.nil
    concatFoldableWith f = D.concatMapFoldableWith f id
    
    Since: 0.8.0 (Renamed foldWith to concatFoldableWith) Since: 0.1.0 (Streamly)

  6. concatForFoldableWith :: forall t f (m :: Type -> Type) b a . (IsStream t, Foldable f) => (t m b -> t m b -> t m b) -> f a -> (a -> t m b) -> t m b

    streamly Streamly.Prelude

    Like concatMapFoldableWith but with the last two arguments reversed i.e. the monadic streaming function is the last argument. Equivalent to:

    concatForFoldableWith f xs g = Prelude.foldr (f . g) D.nil xs
    concatForFoldableWith f = flip (D.concatMapFoldableWith f)
    
    Since: 0.8.0 (Renamed forEachWith to concatForFoldableWith) Since: 0.1.0 (Streamly)

  7. concatMap :: forall t (m :: Type -> Type) a b . (IsStream t, Monad m) => (a -> t m b) -> t m a -> t m b

    streamly Streamly.Prelude

    Map a stream producing function on each element of the stream and then flatten the results into a single stream.

    >>> concatMap f = Stream.concatMapM (return . f)
    
    >>> concatMap f = Stream.concatMapWith Stream.serial f
    
    >>> concatMap f = Stream.concat . Stream.map f
    

  8. concatMapFoldableWith :: forall t f (m :: Type -> Type) b a . (IsStream t, Foldable f) => (t m b -> t m b -> t m b) -> (a -> t m b) -> f a -> t m b

    streamly Streamly.Prelude

    A variant of foldMap that allows you to map a monadic streaming action on a Foldable container and then fold it using the specified stream merge operation.

    concatMapFoldableWith async return [1..3]
    
    Equivalent to:
    concatMapFoldableWith f g = Prelude.foldr (f . g) S.nil
    concatMapFoldableWith f g xs = S.concatMapWith f g (S.fromFoldable xs)
    
    Since: 0.8.0 (Renamed foldMapWith to concatMapFoldableWith) Since: 0.1.0 (Streamly)

  9. concatMapM :: (IsStream t, Monad m) => (a -> m (t m b)) -> t m a -> t m b

    streamly Streamly.Prelude

    Map a stream producing monadic function on each element of the stream and then flatten the results into a single stream. Since the stream generation function is monadic, unlike concatMap, it can produce an effect at the beginning of each iteration of the inner loop.

  10. concatMapWith :: forall t (m :: Type -> Type) b a . IsStream t => (t m b -> t m b -> t m b) -> (a -> t m b) -> t m a -> t m b

    streamly Streamly.Prelude

    concatMapWith mixer generator stream is a two dimensional looping combinator. The generator function is used to generate streams from the elements in the input stream and the mixer function is used to merge those streams. Note we can merge streams concurrently by using a concurrent merge function. Since: 0.7.0 Since: 0.8.0 (signature change)

Page 6 of many | Previous | Next