Functors representing data structures that can be traversed from left to right.
Functors representing data structures that can be traversed from left to right.
Minimal complete definition: Traversable.traverse or Traversable.sequenceA.
The superclass instances should satisfy the following:
In the Functor instance, Functor.fmap should be equivalent to traversal with the identity applicative functor (fmapDefault).
In the Foldable instance, Foldable.foldMap should be equivalent to traversal with a constant applicative functor (foldMapDefault).
Note that the functions Traversable.mapM, Traversable.sequence, forM are just specialized versions of Traversable.traverse, Traversable.sequenceA and for, and wouldn't be required in Frege. They are included for Haskell compatibility only. In Haskell the specialized functions are needed as Haskell monads are no Applicatives.
Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. This function exists for Haskell compatibility only.
Evaluate each monadic action in the structure from left to right, and collect the results. This function exists for Haskell compatibility only.
Evaluate each action in the structure from left to right, and collect the results.
Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.
for is Traversable.traverse with its arguments flipped.
forM is Traversable.mapM with its arguments flipped.
This function exists for Haskell compatibility only.
access field run
The mapAccumL function behaves like a combination of Functor.fmap and Foldable.fold; it applies a function to each element of a structure, passing an accumulating parameter from left to right, and returning a final value of this accumulator together with the new structure.
access field run
The mapAccumR function behaves like a combination of Functor.fmap and Foldable.foldr; it applies a function to each element of a structure, passing an accumulating parameter from right to left, and returning a final value of this accumulator together with the new structure.
This function may be used as a value for `fmap` in a `Functor` instance, provided that Traversable.traverse is defined. (Using fmapDefault with a Traversable instance defined only by Traversable.sequenceA will result in infinite recursion.)
This function may be used as a value for `Data.Foldable.foldMap` in a `Foldable` instance.
inherited from Applicative.*>
inherited from Applicative.<*
inherited from Applicative.*>
inherited from Applicative.<*
inherited from Traversable.mapM
inherited from Traversable.sequence
inherited from Traversable.sequenceA
inherited from Traversable.mapM
inherited from Traversable.sequence
inherited from Traversable.sequenceA
inherited from Traversable.sequence
inherited from Traversable.sequenceA