11 lines
186 B
JavaScript
11 lines
186 B
JavaScript
|
/**
|
||
|
* @since 2.0.0
|
||
|
*/
|
||
|
export var tailRec = function (startWith, f) {
|
||
|
var ab = f(startWith);
|
||
|
while (ab._tag === 'Left') {
|
||
|
ab = f(ab.left);
|
||
|
}
|
||
|
return ab.right;
|
||
|
};
|