A structure which can be traversed to the structure of same shape by performing Applicative action.
All instances of the traversable functor tra must satisfy the following laws:
Naturality: For all t, f and x; t(tra.traverse(app1)(f)(x)) equals to tra.traverse(app2)((item) => t(f(item)))(x), where app1 and app2 are appropriate applicative functors about f and t respectively,
Identity: For all x; tra.traverse(Identity.applicative)((a) => a)(x) equals to x,
Composition: For all f, g, x and composed applicative functor app for Compose<F, G, _>; tra.traverse(app)((item) => app.map(g)(f(item)))(x) equals to app.map(tra.traverse(app)(g))(tra.traverse(app)(f)(x)).
A structure which can be traversed to the structure of same shape by performing
Applicativeaction.All instances of the traversable functor
tramust satisfy the following laws:t,fandx;t(tra.traverse(app1)(f)(x))equals totra.traverse(app2)((item) => t(f(item)))(x), whereapp1andapp2are appropriate applicative functors aboutfandtrespectively,tra.traverse(Identity.applicative)((a) => a)(x)equals tox,f,g,xand composed applicative functorappforCompose<F, G, _>;tra.traverse(app)((item) => app.map(g)(f(item)))(x)equals toapp.map(tra.traverse(app)(g))(tra.traverse(app)(f)(x)).