Search results

P prelude M Data.Functor
mapAccumL :: forall a b s f. Traversable f => (s -> a -> Accum s b) -> s -> f a -> Accum s (f b)

Fold a data structure from the left, keeping all intermediate results instead of only the final result.

Unlike scanl, mapAccumL allows the type of accumulator to differ from the element type of the final data structure.

P foldable-traversable M Data.Traversable
mapAccumR :: forall a b s f. Traversable f => (s -> a -> Accum s b) -> s -> f a -> Accum s (f b)

Fold a data structure from the right, keeping all intermediate results instead of only the final result.

Unlike scanr, mapAccumR allows the type of accumulator to differ from the element type of the final data structure.

P foldable-traversable M Data.Traversable
mapContT :: forall r m a. (m r -> m r) -> ContT r m a -> ContT r m a

Modify the underlying action in a ContT monad action.

P transformers M Control.Monad.Cont.Trans
mapEnv :: forall e a b. (a -> b) -> Env e a -> Env e b

Change the data type in an Env computation.

P transformers M Control.Comonad.Env
mapEnvT :: forall e w1 w2 a b. (w1 a -> w2 b) -> EnvT e w1 a -> EnvT e w2 b

Change the underlying comonad and data type in an EnvT context.

P transformers M Control.Comonad.Env.Trans
mapExcept :: forall e e' a b. (Either e a -> Either e' b) -> Except e a -> Except e' b

Transform the unwrapped computation using the given function.

P transformers M Control.Monad.Except
mapExceptT :: forall e e' m n a b. (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b

Transform the unwrapped computation using the given function.

P transformers M Control.Monad.Except.Trans
mapFlipped :: forall f a b. Functor f => f a -> (a -> b) -> f b

mapFlipped is map with its arguments reversed. For example:

[1, 2, 3] <#> \n -> n * n
P prelude M Data.Functor
mapMaybe :: forall a b. (a -> Maybe b) -> Array a -> Array b

Apply a function to each element in an array, keeping only the results which contain a value, creating a new array.

P arrays M Data.Array
mapMaybe :: forall f a b. Functor f => (a -> Maybe b) -> ListT f a -> ListT f b

Apply a function to the elements of a list, keeping only those return values which contain a result.

P transformers M Control.Monad.List.Trans
mapMaybeT :: forall m1 m2 a b. (m1 (Maybe a) -> m2 (Maybe b)) -> MaybeT m1 a -> MaybeT m2 b

Change the result type of a MaybeT monad action.

P transformers M Control.Monad.Maybe.Trans
mapReader :: forall r a b. (a -> b) -> Reader r a -> Reader r b

Change the type of the result in a Reader monad action.

P transformers M Control.Monad.Reader
mapReaderT :: forall r m1 m2 a b. (m1 a -> m2 b) -> ReaderT r m1 a -> ReaderT r m2 b

Change the type of the result in a ReaderT monad action.

P transformers M Control.Monad.Reader.Trans
mapRWS :: forall r w1 w2 s a1 a2. (RWSResult s a1 w1 -> RWSResult s a2 w2) -> RWS r w1 s a1 -> RWS r w2 s a2

Change the types of the result and accumulator in a RWS action

P transformers M Control.Monad.RWS
mapRWST :: forall r w1 w2 s m1 m2 a1 a2. (m1 (RWSResult s a1 w1) -> m2 (RWSResult s a2 w2)) -> RWST r w1 s m1 a1 -> RWST r w2 s m2 a2

Change the result and accumulator types in a RWST monad action.

P transformers M Control.Monad.RWS.Trans

P maps

mapState :: forall s a b. (Tuple a s -> Tuple b s) -> State s a -> State s b

Change the type of the result in a State action

P transformers M Control.Monad.State
mapStateT :: forall s m1 m2 a b. (m1 (Tuple a s) -> m2 (Tuple b s)) -> StateT s m1 a -> StateT s m2 b

Change the result type in a StateT monad action.

P transformers M Control.Monad.State.Trans
mapWithIndex :: forall a b. (Int -> a -> b) -> Array a -> Array b

Apply a function to each element in an array, supplying a generated zero-based index integer along with the element, creating an array with the new elements.

P arrays M Data.Array
mapWriter :: forall w1 w2 a b. (Tuple a w1 -> Tuple b w2) -> Writer w1 a -> Writer w2 b

Change the result and accumulator types in a Writer monad action

P transformers M Control.Monad.Writer
mapWriterT :: forall w1 w2 m1 m2 a b. (m1 (Tuple a w1) -> m2 (Tuple b w2)) -> WriterT w1 m1 a -> WriterT w2 m2 b

Change the accumulator and base monad types in a WriterT monad action.

P transformers M Control.Monad.Writer.Trans