main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
526 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import _xfBase from "./_xfBase.js";
|
---|
| 2 |
|
---|
| 3 | var XMap =
|
---|
| 4 | /*#__PURE__*/
|
---|
| 5 | function () {
|
---|
| 6 | function XMap(f, xf) {
|
---|
| 7 | this.xf = xf;
|
---|
| 8 | this.f = f;
|
---|
| 9 | }
|
---|
| 10 |
|
---|
| 11 | XMap.prototype['@@transducer/init'] = _xfBase.init;
|
---|
| 12 | XMap.prototype['@@transducer/result'] = _xfBase.result;
|
---|
| 13 |
|
---|
| 14 | XMap.prototype['@@transducer/step'] = function (result, input) {
|
---|
| 15 | return this.xf['@@transducer/step'](result, this.f(input));
|
---|
| 16 | };
|
---|
| 17 |
|
---|
| 18 | return XMap;
|
---|
| 19 | }();
|
---|
| 20 |
|
---|
| 21 | var _xmap = function _xmap(f) {
|
---|
| 22 | return function (xf) {
|
---|
| 23 | return new XMap(f, xf);
|
---|
| 24 | };
|
---|
| 25 | };
|
---|
| 26 |
|
---|
| 27 | export default _xmap; |
---|
Note:
See
TracBrowser
for help on using the repository browser.