_xpromap.js 607 B

123456789101112131415161718192021222324252627
  1. import _xfBase from "./_xfBase.js";
  2. import _promap from "./_promap.js";
  3. var XPromap =
  4. /*#__PURE__*/
  5. function () {
  6. function XPromap(f, g, xf) {
  7. this.xf = xf;
  8. this.f = f;
  9. this.g = g;
  10. }
  11. XPromap.prototype['@@transducer/init'] = _xfBase.init;
  12. XPromap.prototype['@@transducer/result'] = _xfBase.result;
  13. XPromap.prototype['@@transducer/step'] = function (result, input) {
  14. return this.xf['@@transducer/step'](result, _promap(this.f, this.g, input));
  15. };
  16. return XPromap;
  17. }();
  18. export default function _xpromap(f, g) {
  19. return function (xf) {
  20. return new XPromap(f, g, xf);
  21. };
  22. }