Compiled: Wed Dec 05 00:09:52 PST 2012 from source file: ./frege/control/Traversable.fr
This module provide type class Traversable and instances for [] and Maybe
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.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.
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
access field run
access field run
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.
for is Traversable.traverse with its arguments flipped.
forM is Traversable.mapM with its arguments flipped.
This function exists for Haskell compatibility only.
The mapAccumL function behaves like a combination of Functor.fmap and Foldable.Foldable.foldl; 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.
The mapAccumR function behaves like a combination of Functor.fmap and Foldable.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.
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 action in the structure from left to right, and collect the results.
Evaluate each monadic action in the structure from left to right, and collect the results. This function exists for Haskell compatibility only.
Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.