ForgetfulTraverseLaws
dev.constructive.eo.laws.typeclass.ForgetfulTraverseLaws
Law equations for any ForgetfulTraverse[F, Applicative] — cats' Traverse laws restated for the two-parameter carrier, at fixed effects:
- identity:
traverse[Id](fa)(a => a) == fa; - sequential composition: traversing under
Nested[List, Option]equals traversing underList, then each branch underOption; - parallel composition: traversing under
Tuple2K[List, Vector]equals the pair of the two separate traversals; - multi-shot agreement: traversing under
Listgives cats' cartesian productTraverse[List].traverse(foci)(f)over the carrier's foci (read offForgetfulFold), each choice written back intofa.
The effects are deliberately MULTI-SHOT (List, Vector resume every continuation once per branch; Tuple2K once per component): a traverse that threads one mutable result through map2 passes every single-shot law (Id, Option, Const) yet hands all branches the same result. The last law is the one that pins a branch to its values; the composition laws compare the carrier only with itself.
The [_ <: Distributive] flavour (ModifyF) is not covered: it collapses to a tautology at Id.
Attributes
- Source
- ForgetfulTraverseLaws.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
In this article