@mikuroxina/mini-fn
    Preparing search index...

    Type Alias Traversable<T>

    Traversable: TypeClass.Functor.Functor<T> & TypeClass.Foldable.Foldable<T> & {
        traverse: <F>(
            app: TypeClass.Applicative.Applicative<F>,
        ) => <A, B>(
            visitor: (a: A) => Get1<F, B>,
        ) => (data: Get1<T, A>) => Get1<F, Get1<T, B>>;
    }

    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)).

    Type Parameters

    • T

    Type Declaration

    • Readonlytraverse: <F>(
          app: TypeClass.Applicative.Applicative<F>,
      ) => <A, B>(
          visitor: (a: A) => Get1<F, B>,
      ) => (data: Get1<T, A>) => Get1<F, Get1<T, B>>

      Maps each item of the structure data to an action, and evaluates them from left to right, then collects the result.