Skip to main content

Daml module

DA.Traversable

Class of data structures that can be traversed from left to right, performing an action on each element.

Typeclasses

class (Functor t, Foldable t) => Traversable t

Functors representing data structures that can be traversed from left to right. Methods:
  • mapA : Applicative f => (a -> f b) -> t a -> f (t b) Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.
  • sequence : Applicative f => t (f a) -> f (t a) Evaluate each action in the structure from left to right, and collect the results.
Instances:

Functions

forA

forA : (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b) forA is mapA with its arguments flipped.

History

Added3.4.9