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. mapError :: (MonadError e m, MonadError e' n) => (m (Either e a) -> n (Either e' b)) -> m a -> n b

    can-i-haz Control.Monad.Except.CoHas

    MonadError analogue of the mapExceptT function. The computation is unwrapped, a function is applied to the Either, and the result is lifted into the second MonadError instance.

  2. mapExcept :: (Either e a -> Either e' b) -> Except e a -> Except e' b

    can-i-haz Control.Monad.Except.CoHas

    Map the unwrapped computation using the given function.

  3. mapExceptT :: (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b

    can-i-haz Control.Monad.Except.CoHas

    Map the unwrapped computation using the given function.

  4. mapReader :: (a -> b) -> Reader r a -> Reader r b

    can-i-haz Control.Monad.Reader.Has

    Transform the value returned by a Reader.

  5. mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n b

    can-i-haz Control.Monad.Reader.Has

    Transform the computation inside a ReaderT.

  6. mapAccumL :: forall acc x y (n :: Nat) . (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y)

    clash-prelude Clash.Explicit.Prelude

    The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a vector, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new vector.

    >>> mapAccumL (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil)
    (10,1 :> 2 :> 4 :> 7 :> Nil)
    
    "mapAccumL f acc xs" corresponds to the following circuit layout:

  7. mapAccumR :: forall acc x y (n :: Nat) . (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y)

    clash-prelude Clash.Explicit.Prelude

    The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a vector, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new vector.

    >>> mapAccumR (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil)
    (10,10 :> 8 :> 5 :> 1 :> Nil)
    
    "mapAccumR f acc xs" corresponds to the following circuit layout:

  8. mapAccumL :: forall acc x y (n :: Nat) . (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y)

    clash-prelude Clash.Explicit.Prelude.Safe

    The mapAccumL function behaves like a combination of map and foldl; it applies a function to each element of a vector, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new vector.

    >>> mapAccumL (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil)
    (10,1 :> 2 :> 4 :> 7 :> Nil)
    
    "mapAccumL f acc xs" corresponds to the following circuit layout:

  9. mapAccumR :: forall acc x y (n :: Nat) . (acc -> x -> (acc, y)) -> acc -> Vec n x -> (acc, Vec n y)

    clash-prelude Clash.Explicit.Prelude.Safe

    The mapAccumR function behaves like a combination of map and foldr; it applies a function to each element of a vector, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new vector.

    >>> mapAccumR (\acc x -> (acc + x,acc + 1)) 0 (1 :> 2 :> 3 :> 4 :> Nil)
    (10,10 :> 8 :> 5 :> 1 :> Nil)
    
    "mapAccumR f acc xs" corresponds to the following circuit layout:

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

    clash-prelude Clash.HaskellPrelude

    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.

Page 279 of many | Previous | Next