1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
|
8 |
|
9 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
10 |
|
11 | var Identity = (function () {
|
12 | function Identity(v) {
|
13 | _classCallCheck(this, Identity);
|
14 |
|
15 | this.value = v;
|
16 | }
|
17 |
|
18 | _createClass(Identity, [{
|
19 | key: "map",
|
20 | value: function map(f) {
|
21 | return new Identity(f(this.value));
|
22 | }
|
23 | }, {
|
24 | key: "ap",
|
25 | value: function ap(v) {
|
26 | return new Identity(this.value(v.value));
|
27 | }
|
28 | }, {
|
29 | key: "extract",
|
30 | value: function extract() {
|
31 | return this.value;
|
32 | }
|
33 | }]);
|
34 |
|
35 | return Identity;
|
36 | })();
|
37 |
|
38 | exports["default"] = Identity;
|
39 |
|
40 | Identity.of = function (v) {
|
41 | return new Identity(v);
|
42 | };
|
43 | module.exports = exports["default"]; |
\ | No newline at end of file |