Hoogle Search

Within LTS Haskell 24.34 (ghc-9.10.3)

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

  1. mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)

    classy-prelude-yesod ClassyPrelude.Yesod

    Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.

    Examples

    mapM is literally a traverse with a type signature restricted to Monad. Its implementation may be more efficient due to additional power of Monad.

  2. mapMC :: Monad m => (a -> m b) -> ConduitT a b m ()

    classy-prelude-yesod ClassyPrelude.Yesod

    Apply a monadic transformation to all values in a stream. If you do not need the transformed values, and instead just want the monadic side-effects of running the action, see mapM_.

  3. mapMCE :: (Monad m, Traversable f) => (a -> m b) -> ConduitT (f a) (f b) m ()

    classy-prelude-yesod ClassyPrelude.Yesod

    Apply a monadic transformation to all elements in a chunked stream.

  4. mapM_ :: (MonoFoldable mono, Applicative m) => (Element mono -> m ()) -> mono -> m ()

    classy-prelude-yesod ClassyPrelude.Yesod

    Synonym for omapM_

  5. mapM_C :: Monad m => (a -> m ()) -> ConduitT a o m ()

    classy-prelude-yesod ClassyPrelude.Yesod

    Apply the action to all values in the stream. Note: if you want to pass the values instead of consuming them, use iterM instead.

  6. mapM_CE :: (Monad m, MonoFoldable mono) => (Element mono -> m ()) -> ConduitT mono o m ()

    classy-prelude-yesod ClassyPrelude.Yesod

    Apply the action to all elements in the chunked stream. Note: the same caveat as with mapM_C applies. If you don't want to consume the values, you can use iterM:

    iterM (omapM_ f)
    

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

    classy-prelude-yesod ClassyPrelude.Yesod

    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. mapNonNull :: (Functor f, MonoFoldable (f b)) => (a -> b) -> NonNull (f a) -> NonNull (f b)

    classy-prelude-yesod ClassyPrelude.Yesod

    fmap over the underlying container in a NonNull.

  9. mapOutput :: forall (m :: Type -> Type) o1 o2 i r . Monad m => (o1 -> o2) -> ConduitT i o1 m r -> ConduitT i o2 m r

    classy-prelude-yesod ClassyPrelude.Yesod

    Apply a function to all the output values of a ConduitT. This mimics the behavior of fmap for a Source and Conduit in pre-0.4 days. It can also be simulated by fusing with the map conduit from Data.Conduit.List. Since 0.4.1

  10. mapOutputMaybe :: forall (m :: Type -> Type) o1 o2 i r . Monad m => (o1 -> Maybe o2) -> ConduitT i o1 m r -> ConduitT i o2 m r

    classy-prelude-yesod ClassyPrelude.Yesod

    Same as mapOutput, but use a function that returns Maybe values. Since 0.5.0

Page 337 of many | Previous | Next