Search results

map :: forall f a b. Functor f => (a -> b) -> f a -> f b
P prelude M Data.Functor

Map k v represents maps from keys of type k to values of type v.

P ordered-collections M Data.Map.Internal
map :: forall a b. Ord b => (a -> b) -> Set a -> Set b

Maps over the values in a set.

This operation is not structure-preserving for sets, so is not a valid Functor. An example case: mapping const x over a set with n > 0 elements will result in a set with one element.

P ordered-collections M Data.Set
map :: forall a b. Ord b => (a -> b) -> NonEmptySet a -> NonEmptySet b

Maps over the values in a set.

This operation is not structure-preserving for sets, so is not a valid Functor. An example case: mapping const x over a set with n > 0 elements will result in a set with one element.

P ordered-collections M Data.Set.NonEmpty
P erl-maps M Erl.Data.Map
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
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
mapCont :: forall r a. (r -> r) -> Cont r a -> Cont r a

Transform the result of a continuation-passing function.

P transformers M Control.Monad.Cont
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
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 heterogeneous M Heterogeneous.Mapping
mapping :: forall a b f. Mapping f a b => f -> a -> b
P heterogeneous M Heterogeneous.Mapping
mapping :: forall s t a b f g. Functor f => Functor g => AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
P profunctor-lenses M Data.Lens.Iso
mapMaybe :: forall a b. (a -> Maybe b) -> List a -> List b

Apply a function to each element in a list, keeping only the results which contain a value.

Running time: O(n)

P lists M Data.List
mapMaybe :: forall a b. (a -> Maybe b) -> List a -> List b

Apply a function to each element in a list, keeping only the results which contain a value.

Running time: O(n)

P lists M Data.List.Lazy
mapMaybe :: forall a b. (a -> Maybe b) -> NonEmptyList a -> List b
P lists M Data.List.NonEmpty
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.

parseEmail :: String -> Maybe Email
parseEmail = ...

mapMaybe parseEmail ["a.com", "hello@example.com", "--"]
   = [Email {user: "hello", domain: "example.com"}]
P arrays M Data.Array
mapMaybe :: forall a b. (a -> Maybe b) -> NonEmptyArray a -> Array b
P arrays M Data.Array.NonEmpty
mapMaybe :: forall k a b. Ord k => (a -> Maybe b) -> Map k a -> Map k b

Applies a function to each value in a map, discarding entries where the function returns Nothing.

P ordered-collections M Data.Map.Internal
mapMaybe :: forall a b. Ord b => (a -> Maybe b) -> Set a -> Set b

Applies a function to each value in a set, discarding entries where the function returns Nothing.

P ordered-collections M Data.Set
mapMaybe :: forall a b. Ord b => (a -> Maybe b) -> NonEmptySet a -> Set b

Applies a function to each value in a set, discarding entries where the function returns Nothing.

P ordered-collections M Data.Set.NonEmpty
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
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
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
mapMaybe :: forall k a b. (a -> Maybe b) -> Map k a -> Map k b

Applies a function to each value in a map, discarding entries where the function returns Nothing.

P erl-maps M Erl.Data.Map
mapReply :: forall state reply mappedReply. (reply -> mappedReply) -> Effect (RestResult reply state) -> Effect (RestResult mappedReply state)
P erl-stetson M Stetson.HandlerProxy
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
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
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
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
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
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
mapDefault :: forall i f a b. FunctorWithIndex i f => (a -> b) -> f a -> f b

A default implementation of Functor's map in terms of mapWithIndex

P foldable-traversable M Data.FunctorWithIndex
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
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
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
mapWithKey :: forall k a b. (k -> a -> b) -> Map k a -> Map k b
P erl-maps M Erl.Data.Map
mapParserT :: forall b n s a m. (m (Tuple (Either ParseError a) (ParseState s)) -> n (Tuple (Either ParseError b) (ParseState s))) -> ParserT s m a -> ParserT s n b

Change the underlying monad action and data type in a ParserT monad action.

P parsing M Text.Parsing.Parser
mapWithIndex :: forall f i a b. FunctorWithIndex i f => (i -> a -> b) -> f a -> f b
P foldable-traversable M Data.FunctorWithIndex
mapWithIndex :: forall a b. (Int -> a -> b) -> List a -> List b

Apply a function to each element and its index in a list starting at 0.

Deprecated. Use Data.FunctorWithIndex instead.

P lists M Data.List
mapWithIndex :: forall a b. (Int -> a -> b) -> NonEmptyList a -> NonEmptyList b

Apply a function to each element and its index in a list starting at 0.

Deprecated. Use Data.FunctorWithIndex instead.

P lists M Data.List.NonEmpty
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.

prefixIndex index element = show index <> element

mapWithIndex prefixIndex ["Hello", "World"] = ["0Hello", "1World"]
P arrays M Data.Array
mapWithIndex :: forall a b. (Int -> a -> b) -> NonEmptyArray a -> NonEmptyArray b
P arrays M Data.Array.NonEmpty
mapIdentityT :: forall m1 m2 a b. (m1 a -> m2 b) -> IdentityT m1 a -> IdentityT m2 b

Change the result type of a IdentityT monad action.

P transformers M Control.Monad.Identity.Trans
P erl-pinto M Pinto.GenServer
mapMaybeWithKey :: forall k a b. Ord k => (k -> a -> Maybe b) -> Map k a -> Map k b

Applies a function to each key/value pair in a map, discarding entries where the function returns Nothing.

P ordered-collections M Data.Map.Internal
mapMaybeWithKey :: forall k a b. (k -> a -> Maybe b) -> Map k a -> Map k b

Applies a function to each key/value pair in a map, discarding entries where the function returns Nothing.

P erl-maps M Erl.Data.Map
P heterogeneous M Heterogeneous.Mapping
P erl-pinto M Pinto.GenServer
P heterogeneous M Heterogeneous.Mapping
mappingWithIndex :: forall a b f i. MappingWithIndex f i a b => f -> i -> a -> b
P heterogeneous M Heterogeneous.Mapping
mapAccumLWithIndex :: forall i a b s f. TraversableWithIndex i f => (i -> s -> a -> Accum s b) -> s -> f a -> Accum s (f b)

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

Unlike scanlWithIndex, mapAccumLWithIndex allows the type of accumulator to differ from the element type of the final data structure.

P foldable-traversable M Data.TraversableWithIndex
mapAccumRWithIndex :: forall i a b s f. TraversableWithIndex i f => (i -> s -> a -> Accum s b) -> s -> f a -> Accum s (f b)

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

Unlike scanrWithIndex, imapAccumRWithIndex allows the type of accumulator to differ from the element type of the final data structure.

P foldable-traversable M Data.TraversableWithIndex
P heterogeneous M Heterogeneous.Mapping
P heterogeneous M Heterogeneous.Mapping
mapVariantWithIndex :: forall as bs f xs proxy. MapVariantWithIndex xs f as bs => proxy xs -> f -> Variant as -> Variant bs
P heterogeneous M Heterogeneous.Mapping
P heterogeneous M Heterogeneous.Mapping
mapVariantFWithIndex :: forall as bs f x xs y proxy. MapVariantFWithIndex xs f as bs x y => proxy xs -> f -> VariantF as x -> VariantF bs y
P heterogeneous M Heterogeneous.Mapping
P heterogeneous M Heterogeneous.Mapping
P heterogeneous M Heterogeneous.Mapping
P heterogeneous M Heterogeneous.Mapping
P heterogeneous M Heterogeneous.Mapping
P heterogeneous M Heterogeneous.Mapping
P heterogeneous M Heterogeneous.Mapping
mapRecordWithIndexBuilder :: forall as bs f xs proxy. MapRecordWithIndex xs f as bs => proxy xs -> f -> Builder (Record as) (Record bs)
P heterogeneous M Heterogeneous.Mapping

No further results.