map -is:exact -is:exact -is:exact package:daml-stdlib -is:exact -is:module -is:exact -is:exact
Apply a function over each element in the non-empty list.
`map f xs` applies the function `f` to all elements of the list `xs`
and returns the list of results (in the same order as `xs`).
The `Map a b` type represents an associative array from keys of type `a`
to values of type `b`. It uses the built-in equality for keys. Import
`DA.Map` to use it.
Map each element of a structure to an action, evaluate these
actions from left to right, and ignore the results. For a version
that doesn't ignore the results see 'DA.Traversable.mapA'.
The `mapAccumL` function combines the behaviours of `map` and
`foldl`; it applies a function to each element of a list, passing
an accumulating parameter from left to right, and returning a final
value of this accumulator together with the new list.
The `mapOptional` function is a version of `map` which can throw out
elements. In particular, the functional argument returns something
of type `Optional b`. If this is `None`, no element is added on to
the result list. If it is `Some b`, then `b` is included in the
result list.
Map each element of a structure to an action, evaluate these actions
from left to right, and collect the results.
Apply an applicative function to each element of a list.
Map over both arguments at the same time.
```daml-force
bimap f g ≡ first f . second g
```
Examples:
```
>>> bimap not (+1) (True, 3)
(False,4)
>>> bimap not (+1) (Left True)
Left False
>>> bimap not (+1) (Right 3)
Right 4
```
Combine the elements of a structure using a monoid.
Create a `Set` from a `Map`.
Convert a `Set` into a `Map`.
The `TextMap a` type represents an associative array from keys of type
`Text` to values of type `a`.
Map a function over each element of a list, and concatenate all the results.
`fmap` takes a function of type `a -> b`, and turns it into a
function of type `f a -> f b`, where `f` is the type which is an
instance of `Functor`.
For example, `map` is an `fmap` that only works on lists.
It takes a function `a -> b` and a `[a]`, and returns a `[b]`.