A functor with application. It can combine sequence computations with apply or liftA2 function.

All instances of the applicative a must satisfy the following laws:

  • Identity: For all x; a.apply(a.pure((i) => i))(x) equals to x,
  • Composition: For all x, y and z; a.apply(a.apply(a.apply(a.pure((f) => (g) => (i) => f(g(i))))(x))(y))(z) equals to a.apply(x)(a.apply(y)(z)),
  • Homomorphism: For all f and x; a.apply(a.pure(f))(a.pure(x)) equals to a.pure(f(x)),
  • Interchange: For all f and x; a.apply(f)(a.pure(x)) equals to a.apply(a.pure((i) => i(x)))(f).

Type Parameters

  • F

Hierarchy

Properties

apply: (<T, U>(fn) => ((t) => Instance<Apply1<F, U>>))

Type declaration

distribute: (<F>(functor) => (<A>(fga) => Instance<Apply1<F, Instance<Apply1<F, A>>>>))

Type declaration

foldR: (<A, B>(folder) => ((init) => ((data) => B)))

Type declaration

    • <A, B>(folder): ((init) => ((data) => B))
    • Folds the data structure with folder function by right associativity.

      Type Parameters

      • A

      • B

      Parameters

      • folder: ((next) => ((acc) => B))

        The function which takes the next and accumulating value and returns the calculated accumulation.

          • (next): ((acc) => B)
          • Parameters

            • next: A

            Returns ((acc) => B)

              • (acc): B
              • Parameters

                • acc: B

                Returns B

      Returns ((init) => ((data) => B))

      The accumulated result value.

        • (init): ((data) => B)
        • Parameters

          • init: B

          Returns ((data) => B)

map: (<T, U>(fn) => ((t) => Instance<Apply1<F, U>>))

Type declaration

pure: (<T>(t) => Instance<Apply1<F, T>>)

Type declaration

traverse: (<F>(app) => (<A, B>(visitor) => ((data) => Instance<Apply1<F, Instance<Apply1<F, B>>>>)))

Type declaration

untainted: (<A>(fa) => A)

Type declaration

    • <A>(fa): A
    • Type Parameters

      • A

      Parameters

      Returns A

Generated using TypeDoc