A 2-arity kind which can split computation. It useful for receiving any composable computation.

All instances of arrow a must satisfy the following laws:

  • Identity arrow: a.arr(Func.id) equals to a.identity(),
  • Composition arrow: For all functions f and g; a.arr(Func.compose(f)(g)) equals to a.compose(a.arr(f))(a.arr(g)),
  • Left interchange: For all f; a.split(a.arr(f))(a.identity()) equals to a.arr(a.split(f)(a.identity())),
  • Left composition: For all functions f and g; a.split(Func.compose(f)(g))(a.identity()) equals to a.compose(a.split(f)(a.identity()))(a.split(g)(a.identity())),
  • Extracting first interchange: For all f; a.compose(a.arr(Tuple.first))(a.split(f)(a.identity())) equals to a.compose(f)(a.arr(Tuple.first)),
  • Independence: For all f and g; a.compose(a.arr(Func.split(Func.id)(g)))(a.split(f)(a.identity())) equals to a.compose(a.split(f)(a.identity()))(a.arr(Func.split(Func.id)(g))),
  • Idempotence: a.compose(a.arr(Tuple.assocR))(a.split(a.split(f)(a.identity()))(a.identity())) equals to a.compose(a.split(f)(a.identity()))(a.arr(Tuple.assocR)).

Type Parameters

  • A

Hierarchy

Properties

arr: (<B, C>(fn) => Get2<A, B, C>)

Type declaration

    • <B, C>(fn): Get2<A, B, C>
    • Lifts a function to an arrow.

      Type Parameters

      • B

      • C

      Parameters

      • fn: ((b) => C)

        The function to be lifted.

          • (b): C
          • Parameters

            • b: B

            Returns C

      Returns Get2<A, B, C>

      The new arrow.

compose: (<B, C>(funcA) => (<A>(funcB) => Instance<Apply2<A, C, A>>))

Type declaration

identity: (<A>() => Instance<Apply2<A, A, A>>)

Type declaration

split: (<B1, C1>(arrow1) => (<B2, C2>(arrow2) => Get2<A, Tuple<B1, B2>, Tuple<C1, C2>>))

Type declaration

    • <B1, C1>(arrow1): (<B2, C2>(arrow2) => Get2<A, Tuple<B1, B2>, Tuple<C1, C2>>)
    • Splits two inputs between two arrows.

      Type Parameters

      • B1

      • C1

      Parameters

      • arrow1: Get2<A, B1, C1>

        The arrow to be mapped on the first.

      Returns (<B2, C2>(arrow2) => Get2<A, Tuple<B1, B2>, Tuple<C1, C2>>)

      The composed arrow.

Generated using TypeDoc