text: 'use strict';
  
  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);
  }