@dillonkearns/elm-graphql
Version:
<img src="https://cdn.jsdelivr.net/gh/martimatix/logo-graphqelm/logo.svg" alt="dillonearns/elm-graphql logo" width="40%" align="right">
22 lines (16 loc) • 629 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.tailRec = tailRec;
var _HKT = require('./HKT');
var _Either = require('./Either');
var either = _interopRequireWildcard(_Either);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function tailRec(f, a) {
var v = f(a);
while (either.isLeft(v)) {
v = f(either.fromLeft(v));
}
return either.fromRight(v);
}