Magma -is:package

This provides a way to peek at the internal structure of a Traversal or IndexedTraversal
This provides a way to peek at the internal structure of a Traversal or IndexedTraversal
A Magma is a tuple (T,magma) consisting of
  • a type a, and
  • a function (magma) :: T -> T -> T
The mathematical laws for a magma are:
  • magma is defined for all possible pairs of type T, and
  • magma is closed in the set of all possible values of type T
or, more tersly,
∀ a, b ∈ T: a ⊕ b ∈ T
These laws are true by construction in haskell: the type signature of and the above mathematical laws are synonyms.
This isomorphism can be used to inspect a Traversal to see how it associates the structure and it can also be used to bake the Traversal into a Magma so that you can traverse over it multiple times.
This isomorphism can be used to inspect an IndexedTraversal to see how it associates the structure and it can also be used to bake the IndexedTraversal into a Magma so that you can traverse over it multiple times with access to the original indices.
Run a Magma where all the individual leaves have been converted to the expected type