arrowjs
John Hughes' arrows.
Usage
- Arrow(f)
Given an function, it creates an arrow.
{ return v + 1;} == 2;
- Arrow.next(arrA, arrB)
Compose two arrows.
{ return v + 1;} { return v - 1;} next == Arrownext ;
- Arrow.first(arr)
Given a tuple, it will run the arrow with the first element of the tuple.
{ return v + 1;} == _1: 11 _2: 4;Arrow == _1: 11 _2: 4;
- Arrow.second(arr)
Given a tuple, it will run the arrow with the second element of the tuple.
{ return v + 1;} == _1: 10 _2: 5;Arrow == _1: 10 _2: 5;
- Arrow.bifur(arrA, arrB)
Given two arrows, apply each arrow to a value and return a tuple.
{ return v + 1;} { return v - 1;} Arrow == _1: 6 _2: 4;
- Arrow.prod(arrA, arrB)
Given two arrows, returns an arrow that receives a tuple and apply each one to the correpondent in the tuple.
{ return v + 1;} { return v - 1;} Arrow == _1: 7 _2: 3;