functype 0.0.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/chunk-35Y3S46C.js +1 -0
  2. package/dist/chunk-377WQNCB.mjs +1 -0
  3. package/dist/chunk-3VJERXBP.js +1 -0
  4. package/dist/chunk-5OCPRWBH.mjs +1 -0
  5. package/dist/chunk-5RNU6GKU.mjs +1 -0
  6. package/dist/chunk-5SPJ52B5.js +1 -0
  7. package/dist/chunk-5VTXJIR3.js +1 -0
  8. package/dist/chunk-5XVNJUCA.js +1 -0
  9. package/dist/chunk-AGJ7VCYK.mjs +1 -0
  10. package/dist/chunk-AU3JU6VY.js +1 -0
  11. package/dist/chunk-BNNK42JC.js +1 -0
  12. package/dist/chunk-FBZLCLTN.mjs +1 -0
  13. package/dist/chunk-HA5XD5KC.mjs +1 -0
  14. package/dist/chunk-L4P3MMUC.mjs +1 -0
  15. package/dist/chunk-LBQXRIXP.mjs +0 -0
  16. package/dist/chunk-NBPFHDR5.js +1 -0
  17. package/dist/chunk-RRAIFS3D.mjs +1 -0
  18. package/dist/chunk-SSP26X5Y.js +1 -0
  19. package/dist/chunk-TVZBBVEV.js +1 -0
  20. package/dist/chunk-V5DD7UJW.mjs +1 -0
  21. package/dist/chunk-VM6KG6UB.mjs +1 -0
  22. package/dist/chunk-ZQB7I77M.js +1 -0
  23. package/dist/collections/index.d.mts +5 -0
  24. package/dist/collections/index.d.ts +5 -0
  25. package/dist/collections/index.js +1 -0
  26. package/dist/collections/index.mjs +0 -0
  27. package/dist/either/Left.d.mts +9 -2
  28. package/dist/either/Left.d.ts +9 -2
  29. package/dist/either/Left.js +1 -1
  30. package/dist/either/Left.mjs +1 -1
  31. package/dist/either/Right.d.mts +9 -2
  32. package/dist/either/Right.d.ts +9 -2
  33. package/dist/either/Right.js +1 -1
  34. package/dist/either/Right.mjs +1 -1
  35. package/dist/either/index.d.mts +44 -2
  36. package/dist/either/index.d.ts +44 -2
  37. package/dist/either/index.js +1 -1
  38. package/dist/either/index.mjs +1 -1
  39. package/dist/functor/index.d.mts +17 -0
  40. package/dist/functor/index.d.ts +17 -0
  41. package/dist/functor/index.js +1 -0
  42. package/dist/functor/index.mjs +0 -0
  43. package/dist/index-18491592.d.ts +33 -0
  44. package/dist/index-3628fb7a.d.ts +15 -0
  45. package/dist/index-64357013.d.ts +33 -0
  46. package/dist/index-8434e22f.d.ts +15 -0
  47. package/dist/index.d.mts +10 -114
  48. package/dist/index.d.ts +10 -114
  49. package/dist/index.js +1 -1
  50. package/dist/index.mjs +0 -1
  51. package/dist/iterable/Seq.d.mts +29 -0
  52. package/dist/iterable/Seq.d.ts +29 -0
  53. package/dist/iterable/Seq.js +1 -0
  54. package/dist/iterable/Seq.mjs +1 -0
  55. package/dist/iterable/index.d.mts +3 -0
  56. package/dist/iterable/index.d.ts +3 -0
  57. package/dist/iterable/index.js +1 -0
  58. package/dist/iterable/index.mjs +0 -0
  59. package/dist/list/IList.d.mts +9 -0
  60. package/dist/list/IList.d.ts +9 -0
  61. package/dist/list/IList.js +1 -0
  62. package/dist/list/IList.mjs +0 -0
  63. package/dist/list/List.d.mts +25 -2
  64. package/dist/list/List.d.ts +25 -2
  65. package/dist/list/List.js +1 -1
  66. package/dist/list/List.mjs +1 -1
  67. package/dist/list/index.d.mts +12 -2
  68. package/dist/list/index.d.ts +12 -2
  69. package/dist/list/index.js +1 -1
  70. package/dist/list/index.mjs +1 -1
  71. package/dist/map/Map.d.mts +7 -2
  72. package/dist/map/Map.d.ts +7 -2
  73. package/dist/map/Map.js +1 -1
  74. package/dist/map/Map.mjs +1 -1
  75. package/dist/map/index.d.mts +35 -6
  76. package/dist/map/index.d.ts +35 -6
  77. package/dist/map/index.js +1 -1
  78. package/dist/map/index.mjs +1 -0
  79. package/dist/map/shim.d.mts +4 -0
  80. package/dist/map/shim.d.ts +4 -0
  81. package/dist/map/shim.js +1 -0
  82. package/dist/map/shim.mjs +1 -0
  83. package/dist/option/IOption.d.mts +3 -0
  84. package/dist/option/IOption.d.ts +3 -0
  85. package/dist/option/IOption.js +1 -0
  86. package/dist/option/IOption.mjs +0 -0
  87. package/dist/option/None.d.mts +21 -2
  88. package/dist/option/None.d.ts +21 -2
  89. package/dist/option/None.js +1 -1
  90. package/dist/option/None.mjs +1 -1
  91. package/dist/option/Some.d.mts +23 -2
  92. package/dist/option/Some.d.ts +23 -2
  93. package/dist/option/Some.js +1 -1
  94. package/dist/option/Some.mjs +1 -1
  95. package/dist/option/index.d.mts +9 -2
  96. package/dist/option/index.d.ts +9 -2
  97. package/dist/option/index.js +1 -1
  98. package/dist/option/index.mjs +1 -1
  99. package/dist/set/Set.d.mts +20 -0
  100. package/dist/set/Set.d.ts +20 -0
  101. package/dist/set/Set.js +1 -0
  102. package/dist/set/Set.mjs +1 -0
  103. package/dist/set/index.d.mts +5 -0
  104. package/dist/set/index.d.ts +5 -0
  105. package/dist/set/index.js +1 -0
  106. package/dist/set/index.mjs +0 -0
  107. package/dist/set/shim.d.mts +4 -0
  108. package/dist/set/shim.d.ts +4 -0
  109. package/dist/set/shim.js +1 -0
  110. package/dist/set/shim.mjs +1 -0
  111. package/dist/try/Try.d.mts +30 -0
  112. package/dist/try/Try.d.ts +30 -0
  113. package/dist/try/Try.js +1 -0
  114. package/dist/try/Try.mjs +1 -0
  115. package/dist/tuple/Tuple.d.mts +2 -0
  116. package/dist/tuple/Tuple.d.ts +2 -0
  117. package/dist/tuple/Tuple.js +1 -0
  118. package/dist/tuple/Tuple.mjs +1 -0
  119. package/dist/tuple/index.d.mts +20 -0
  120. package/dist/tuple/index.d.ts +20 -0
  121. package/dist/tuple/index.js +1 -0
  122. package/dist/tuple/index.mjs +1 -0
  123. package/dist/util/index.d.mts +14 -0
  124. package/dist/util/index.d.ts +14 -0
  125. package/dist/util/index.js +1 -0
  126. package/dist/util/index.mjs +1 -0
  127. package/dist/util/isIterable.d.mts +3 -0
  128. package/dist/util/isIterable.d.ts +3 -0
  129. package/dist/util/isIterable.js +1 -0
  130. package/dist/util/isIterable.mjs +1 -0
  131. package/package.json +2 -2
  132. package/dist/chunk-3BACPU2L.mjs +0 -1
  133. package/dist/chunk-4BM7WJEY.js +0 -1
  134. package/dist/chunk-7F7OFOVC.mjs +0 -1
  135. package/dist/chunk-CMWFJ4NE.mjs +0 -1
  136. package/dist/chunk-ERJUPNUS.mjs +0 -1
  137. package/dist/chunk-IRUJTPRV.js +0 -1
  138. package/dist/chunk-QK32BSMQ.js +0 -1
  139. package/dist/chunk-RSJUG4F6.js +0 -1
  140. package/dist/chunk-SHAM4BB3.js +0 -1
  141. package/dist/chunk-T4ZDAXL2.mjs +0 -1
  142. package/dist/chunk-TAF2HXL3.mjs +0 -1
  143. package/dist/chunk-ZQN22FM6.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var _chunkAU3JU6VYjs = require('./chunk-AU3JU6VY.js');var n=class r extends _chunkAU3JU6VYjs.a{constructor(t){super(t)}map(t){return new r(super.map(t).toArray())}flatMap(t){return new r(super.flatMap(t).toArray())}remove(t){let i=new r().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new r(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let e=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new r(e)}get(t){return _chunkAU3JU6VYjs.d.call(void 0, this.toArray()[t])}concat(t){return new r([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new s(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var s=class r extends _chunkAU3JU6VYjs.a{constructor(t){super(new (0, _chunk3VJERXBPjs.a)(t))}add(t){return new r([...this.values,t])}remove(t){let e=new _chunk3VJERXBPjs.a;return e.delete(t)?new r(e):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new r(super.map(t).toArray())}flatMap(t){return new r(super.flatMap(t).toArray())}toList(){return new n(this.toArray())}toSet(){return this}};exports.a = s; exports.b = n;
@@ -0,0 +1 @@
1
+ var p=Map;export{p as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var t=Set;exports.a = t;
@@ -0,0 +1 @@
1
+ import{b as r}from"./chunk-FBZLCLTN.mjs";import{e}from"./chunk-5RNU6GKU.mjs";var i=class s{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new s(t(this.value))}flatMap(t){return t(this.value)}toOption(){return e(this.value)}toList(){return new r([this.value])}};export{i as a};
@@ -0,0 +1 @@
1
+ import{a as l}from"./chunk-RRAIFS3D.mjs";import{a as p}from"./chunk-U5EUM74A.mjs";var a=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}};var i=class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};var s=t=>t?f(t):A(),f=t=>new a(t),A=()=>new i;var n=class t{constructor(e){p(this,"values");l(e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let o=e(u);o instanceof t&&r.push(...o.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):A()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,o)=>r(o,u),e)}};export{n as a,a as b,i as c,s as d,f as e,A as f};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZQB7I77Mjs = require('./chunk-ZQB7I77M.js');var _chunk5XVNJUCAjs = require('./chunk-5XVNJUCA.js');var L=t=>new (0, _chunkZQB7I77Mjs.a)(t),R= exports.b =t=>new (0, _chunk5XVNJUCAjs.a)(t);exports.a = L; exports.b = R;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var p=Map;exports.a = p;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk35Y3S46Cjs = require('./chunk-35Y3S46C.js');var _chunkAU3JU6VYjs = require('./chunk-AU3JU6VY.js');var i=class s{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new s(t(this.value))}flatMap(t){return t(this.value)}toOption(){return _chunkAU3JU6VYjs.e.call(void 0, this.value)}toList(){return new (0, _chunk35Y3S46Cjs.b)([this.value])}};exports.a = i;
@@ -0,0 +1 @@
1
+ import{a as i}from"./chunk-L4P3MMUC.mjs";import{a as r}from"./chunk-5OCPRWBH.mjs";var L=t=>new i(t),R=t=>new r(t);export{L as a,R as b};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunkVTKL7OQIjs = require('./chunk-VTKL7OQI.js');var a=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}};var i=class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};var s=t=>t?f(t):A(),f= exports.e =t=>new a(t),A= exports.f =()=>new i;var n=class t{constructor(e){_chunkVTKL7OQIjs.a.call(void 0, this,"values");_chunkBNNK42JCjs.a.call(void 0, e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let o=e(u);o instanceof t&&r.push(...o.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):A()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,o)=>r(o,u),e)}};exports.a = n; exports.b = a; exports.c = i; exports.d = s; exports.e = f; exports.f = A;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";exports.a = e;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-HA5XD5KC.mjs";import{a as o,d as A}from"./chunk-5RNU6GKU.mjs";var n=class r extends o{constructor(t){super(t)}map(t){return new r(super.map(t).toArray())}flatMap(t){return new r(super.flatMap(t).toArray())}remove(t){let i=new r().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new r(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let e=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new r(e)}get(t){return A(this.toArray()[t])}concat(t){return new r([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new s(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var s=class r extends o{constructor(t){super(new a(t))}add(t){return new r([...this.values,t])}remove(t){let e=new a;return e.delete(t)?new r(e):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new r(super.map(t).toArray())}flatMap(t){return new r(super.flatMap(t).toArray())}toList(){return new n(this.toArray())}toSet(){return this}};export{s as a,n as b};
@@ -0,0 +1 @@
1
+ var t=Set;export{t as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-FBZLCLTN.mjs";import{f as i}from"./chunk-5RNU6GKU.mjs";var o=class t{constructor(r){this.value=r}isLeft(){return!0}isRight(){return!1}map(r){return new t(this.value)}flatMap(r){return new t(this.value)}toOption(){return i()}toList(){return new e}};export{o as a};
File without changes
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSSP26X5Yjs = require('./chunk-SSP26X5Y.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunk35Y3S46Cjs = require('./chunk-35Y3S46C.js');var _chunkAU3JU6VYjs = require('./chunk-AU3JU6VY.js');var _chunkVTKL7OQIjs = require('./chunk-VTKL7OQI.js');var o=class s{constructor(e){_chunkVTKL7OQIjs.a.call(void 0, this,"values");this.values=new (0, _chunk5VTXJIR3js.a)(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new (0, _chunkSSP26X5Yjs.a)([e,t]))}add(e){return new s(this.values.set(e[0],e[1]).entries())}remove(e){let t=new s([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){let t=[];for(let[r,u]of this.values.entries())t.push([r,e(u)]);return new s(t)}flatMap(e){let t=[];for(let[r,u]of this.values.entries()){let a=e(u);if(a instanceof s)for(let[f,c]of a.values.entries())t.push([f,c])}return new s(t)}reduce(e){return new (0, _chunkAU3JU6VYjs.a)(this.entries).reduce(e)}reduceRight(e){return new (0, _chunkAU3JU6VYjs.a)(this.entries).reduceRight(e)}foldLeft(e){let t=new (0, _chunkAU3JU6VYjs.a)(this.entries);return r=>t.foldLeft(e)(r)}foldRight(e){let t=new (0, _chunkAU3JU6VYjs.a)(this.entries);return r=>t.foldRight(e)(r)}get(e){return _chunkAU3JU6VYjs.d.call(void 0, this.values.get(e))}getOrElse(e,t){return _chunkAU3JU6VYjs.d.call(void 0, this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let r=_chunkAU3JU6VYjs.d.call(void 0, this.values.get(e));return t}toList(){return new (0, _chunk35Y3S46Cjs.b)(this.entries)}toSet(){return new (0, _chunk35Y3S46Cjs.a)(this.entries)}},M=new o([["a",1],["b",2],["c",3]]);exports.a = o;
@@ -0,0 +1 @@
1
+ var e=t=>t!=null&&typeof t[Symbol.iterator]=="function";export{e as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var t=class s{constructor(e){this.values=e}map(e){let r=e(this.values);return new s(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let a=this.values[e];if(r){if(r(this.values))return a;throw new Error("Cannot cast tuple value")}else return a}toArray(){return this.values}};exports.a = t;
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1 @@
1
+ import{a as m}from"./chunk-VM6KG6UB.mjs";import{a as V}from"./chunk-377WQNCB.mjs";import{a as p,b as K}from"./chunk-FBZLCLTN.mjs";import{a as n,d as i}from"./chunk-5RNU6GKU.mjs";import{a as l}from"./chunk-U5EUM74A.mjs";var o=class s{constructor(e){l(this,"values");this.values=new V(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new m([e,t]))}add(e){return new s(this.values.set(e[0],e[1]).entries())}remove(e){let t=new s([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){let t=[];for(let[r,u]of this.values.entries())t.push([r,e(u)]);return new s(t)}flatMap(e){let t=[];for(let[r,u]of this.values.entries()){let a=e(u);if(a instanceof s)for(let[f,c]of a.values.entries())t.push([f,c])}return new s(t)}reduce(e){return new n(this.entries).reduce(e)}reduceRight(e){return new n(this.entries).reduceRight(e)}foldLeft(e){let t=new n(this.entries);return r=>t.foldLeft(e)(r)}foldRight(e){let t=new n(this.entries);return r=>t.foldRight(e)(r)}get(e){return i(this.values.get(e))}getOrElse(e,t){return i(this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let r=i(this.values.get(e));return t}toList(){return new K(this.entries)}toSet(){return new p(this.entries)}},M=new o([["a",1],["b",2],["c",3]]);export{o as a};
@@ -0,0 +1 @@
1
+ var t=class s{constructor(e){this.values=e}map(e){let r=e(this.values);return new s(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let a=this.values[e];if(r){if(r(this.values))return a;throw new Error("Cannot cast tuple value")}else return a}toArray(){return this.values}};export{t as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk35Y3S46Cjs = require('./chunk-35Y3S46C.js');var _chunkAU3JU6VYjs = require('./chunk-AU3JU6VY.js');var o=class t{constructor(r){this.value=r}isLeft(){return!0}isRight(){return!1}map(r){return new t(this.value)}flatMap(r){return new t(this.value)}toOption(){return _chunkAU3JU6VYjs.f.call(void 0, )}toList(){return new _chunk35Y3S46Cjs.b}};exports.a = o;
@@ -0,0 +1,5 @@
1
+ export { a as ICollection, b as IConverters } from '../index-3628fb7a.js';
2
+ import '../list/IList.mjs';
3
+ import '../index-18491592.js';
4
+ import '../functor/index.mjs';
5
+ import '../index.mjs';
@@ -0,0 +1,5 @@
1
+ export { a as ICollection, b as IConverters } from '../index-8434e22f.js';
2
+ import '../list/IList.js';
3
+ import '../index-64357013.js';
4
+ import '../functor/index.js';
5
+ import '../index.js';
@@ -0,0 +1 @@
1
+ "use strict";
File without changes
@@ -1,2 +1,9 @@
1
- export { Left } from '../index.mjs';
2
- import '../error/ParseError.mjs';
1
+ export { Left } from './index.mjs';
2
+ import '../list/List.mjs';
3
+ import '../index-18491592.js';
4
+ import '../functor/index.mjs';
5
+ import '../iterable/Seq.mjs';
6
+ import '../index.mjs';
7
+ import '../index-3628fb7a.js';
8
+ import '../list/IList.mjs';
9
+ import '../set/Set.mjs';
@@ -1,2 +1,9 @@
1
- export { Left } from '../index.js';
2
- import '../error/ParseError.js';
1
+ export { Left } from './index.js';
2
+ import '../list/List.js';
3
+ import '../index-64357013.js';
4
+ import '../functor/index.js';
5
+ import '../iterable/Seq.js';
6
+ import '../index.js';
7
+ import '../index-8434e22f.js';
8
+ import '../list/IList.js';
9
+ import '../set/Set.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZQN22FM6js = require('../chunk-ZQN22FM6.js');require('../chunk-RSJUG4F6.js');require('../chunk-IRUJTPRV.js');require('../chunk-QK32BSMQ.js');require('../chunk-ZTL76QDL.js');require('../chunk-SHAM4BB3.js');require('../chunk-4BM7WJEY.js');require('../chunk-VTKL7OQI.js');exports.Left = _chunkZQN22FM6js.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZQB7I77Mjs = require('../chunk-ZQB7I77M.js');require('../chunk-35Y3S46C.js');require('../chunk-3VJERXBP.js');require('../chunk-AU3JU6VY.js');require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.Left = _chunkZQB7I77Mjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-CMWFJ4NE.mjs";import"../chunk-7F7OFOVC.mjs";import"../chunk-TAF2HXL3.mjs";import"../chunk-ERJUPNUS.mjs";import"../chunk-CFYIJKWF.mjs";import"../chunk-T4ZDAXL2.mjs";import"../chunk-3BACPU2L.mjs";import"../chunk-U5EUM74A.mjs";export{a as Left};
1
+ import{a}from"../chunk-L4P3MMUC.mjs";import"../chunk-FBZLCLTN.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-5RNU6GKU.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U5EUM74A.mjs";export{a as Left};
@@ -1,2 +1,9 @@
1
- export { Right } from '../index.mjs';
2
- import '../error/ParseError.mjs';
1
+ export { Right } from './index.mjs';
2
+ import '../list/List.mjs';
3
+ import '../index-18491592.js';
4
+ import '../functor/index.mjs';
5
+ import '../iterable/Seq.mjs';
6
+ import '../index.mjs';
7
+ import '../index-3628fb7a.js';
8
+ import '../list/IList.mjs';
9
+ import '../set/Set.mjs';
@@ -1,2 +1,9 @@
1
- export { Right } from '../index.js';
2
- import '../error/ParseError.js';
1
+ export { Right } from './index.js';
2
+ import '../list/List.js';
3
+ import '../index-64357013.js';
4
+ import '../functor/index.js';
5
+ import '../iterable/Seq.js';
6
+ import '../index.js';
7
+ import '../index-8434e22f.js';
8
+ import '../list/IList.js';
9
+ import '../set/Set.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZQN22FM6js = require('../chunk-ZQN22FM6.js');require('../chunk-RSJUG4F6.js');require('../chunk-IRUJTPRV.js');require('../chunk-QK32BSMQ.js');require('../chunk-ZTL76QDL.js');require('../chunk-SHAM4BB3.js');require('../chunk-4BM7WJEY.js');require('../chunk-VTKL7OQI.js');exports.Right = _chunkZQN22FM6js.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5XVNJUCAjs = require('../chunk-5XVNJUCA.js');require('../chunk-35Y3S46C.js');require('../chunk-3VJERXBP.js');require('../chunk-AU3JU6VY.js');require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.Right = _chunk5XVNJUCAjs.a;
@@ -1 +1 @@
1
- import{b as a}from"../chunk-CMWFJ4NE.mjs";import"../chunk-7F7OFOVC.mjs";import"../chunk-TAF2HXL3.mjs";import"../chunk-ERJUPNUS.mjs";import"../chunk-CFYIJKWF.mjs";import"../chunk-T4ZDAXL2.mjs";import"../chunk-3BACPU2L.mjs";import"../chunk-U5EUM74A.mjs";export{a as Right};
1
+ import{a}from"../chunk-5OCPRWBH.mjs";import"../chunk-FBZLCLTN.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-5RNU6GKU.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U5EUM74A.mjs";export{a as Right};
@@ -1,2 +1,44 @@
1
- import '../error/ParseError.mjs';
2
- export { Either, Left, Right, left, parseNumber, right } from '../index.mjs';
1
+ import { List } from '../list/List.mjs';
2
+ import { I as IOption } from '../index-18491592.js';
3
+ import { IFunctor } from '../functor/index.mjs';
4
+ import '../iterable/Seq.mjs';
5
+ import '../index-3628fb7a.js';
6
+ import '../list/IList.mjs';
7
+ import '../set/Set.mjs';
8
+ import '../index.mjs';
9
+
10
+ declare class Left<L, R> implements Either<L, R> {
11
+ value: L;
12
+ constructor(value: L);
13
+ isLeft(): this is Left<L, R>;
14
+ isRight(): this is Right<L, R>;
15
+ map<U>(_f: (value: R) => U): Either<L, U>;
16
+ flatMap<U>(_f: (value: R) => Either<L, U>): Either<L, U>;
17
+ toOption(): IOption<R>;
18
+ toList(): List<R>;
19
+ }
20
+
21
+ declare class Right<L, R> implements Either<L, R> {
22
+ value: R;
23
+ constructor(value: R);
24
+ isLeft(): this is Left<L, R>;
25
+ isRight(): this is Right<L, R>;
26
+ map<U>(f: (value: R) => U): Either<L, U>;
27
+ flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
28
+ toOption(): IOption<R>;
29
+ toList(): List<R>;
30
+ }
31
+
32
+ interface Either<L, R> extends IFunctor<R> {
33
+ value: L | R;
34
+ isLeft(): this is Left<L, R>;
35
+ isRight(): this is Right<L, R>;
36
+ map<U>(f: (value: R) => U): Either<L, U>;
37
+ flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
38
+ toOption(): IOption<R>;
39
+ toList(): List<R>;
40
+ }
41
+ declare const left: <L, R>(value: L) => Either<L, R>;
42
+ declare const right: <L, R>(value: R) => Either<L, R>;
43
+
44
+ export { Either, Left, Right, left, right };
@@ -1,2 +1,44 @@
1
- import '../error/ParseError.js';
2
- export { Either, Left, Right, left, parseNumber, right } from '../index.js';
1
+ import { List } from '../list/List.js';
2
+ import { I as IOption } from '../index-64357013.js';
3
+ import { IFunctor } from '../functor/index.js';
4
+ import '../iterable/Seq.js';
5
+ import '../index-8434e22f.js';
6
+ import '../list/IList.js';
7
+ import '../set/Set.js';
8
+ import '../index.js';
9
+
10
+ declare class Left<L, R> implements Either<L, R> {
11
+ value: L;
12
+ constructor(value: L);
13
+ isLeft(): this is Left<L, R>;
14
+ isRight(): this is Right<L, R>;
15
+ map<U>(_f: (value: R) => U): Either<L, U>;
16
+ flatMap<U>(_f: (value: R) => Either<L, U>): Either<L, U>;
17
+ toOption(): IOption<R>;
18
+ toList(): List<R>;
19
+ }
20
+
21
+ declare class Right<L, R> implements Either<L, R> {
22
+ value: R;
23
+ constructor(value: R);
24
+ isLeft(): this is Left<L, R>;
25
+ isRight(): this is Right<L, R>;
26
+ map<U>(f: (value: R) => U): Either<L, U>;
27
+ flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
28
+ toOption(): IOption<R>;
29
+ toList(): List<R>;
30
+ }
31
+
32
+ interface Either<L, R> extends IFunctor<R> {
33
+ value: L | R;
34
+ isLeft(): this is Left<L, R>;
35
+ isRight(): this is Right<L, R>;
36
+ map<U>(f: (value: R) => U): Either<L, U>;
37
+ flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
38
+ toOption(): IOption<R>;
39
+ toList(): List<R>;
40
+ }
41
+ declare const left: <L, R>(value: L) => Either<L, R>;
42
+ declare const right: <L, R>(value: R) => Either<L, R>;
43
+
44
+ export { Either, Left, Right, left, right };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZQN22FM6js = require('../chunk-ZQN22FM6.js');require('../chunk-RSJUG4F6.js');require('../chunk-IRUJTPRV.js');require('../chunk-QK32BSMQ.js');require('../chunk-ZTL76QDL.js');require('../chunk-SHAM4BB3.js');require('../chunk-4BM7WJEY.js');require('../chunk-VTKL7OQI.js');exports.Left = _chunkZQN22FM6js.a; exports.Right = _chunkZQN22FM6js.b; exports.left = _chunkZQN22FM6js.c; exports.parseNumber = _chunkZQN22FM6js.e; exports.right = _chunkZQN22FM6js.d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5SPJ52B5js = require('../chunk-5SPJ52B5.js');var _chunkZQB7I77Mjs = require('../chunk-ZQB7I77M.js');var _chunk5XVNJUCAjs = require('../chunk-5XVNJUCA.js');require('../chunk-35Y3S46C.js');require('../chunk-3VJERXBP.js');require('../chunk-AU3JU6VY.js');require('../chunk-BNNK42JC.js');require('../chunk-VTKL7OQI.js');exports.Left = _chunkZQB7I77Mjs.a; exports.Right = _chunk5XVNJUCAjs.a; exports.left = _chunk5SPJ52B5js.a; exports.right = _chunk5SPJ52B5js.b;
@@ -1 +1 @@
1
- import{a,b,c,d,e}from"../chunk-CMWFJ4NE.mjs";import"../chunk-7F7OFOVC.mjs";import"../chunk-TAF2HXL3.mjs";import"../chunk-ERJUPNUS.mjs";import"../chunk-CFYIJKWF.mjs";import"../chunk-T4ZDAXL2.mjs";import"../chunk-3BACPU2L.mjs";import"../chunk-U5EUM74A.mjs";export{a as Left,b as Right,c as left,e as parseNumber,d as right};
1
+ import{a as c,b as d}from"../chunk-AGJ7VCYK.mjs";import{a}from"../chunk-L4P3MMUC.mjs";import{a as b}from"../chunk-5OCPRWBH.mjs";import"../chunk-FBZLCLTN.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-5RNU6GKU.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-U5EUM74A.mjs";export{a as Left,b as Right,c as left,d as right};
@@ -0,0 +1,17 @@
1
+ type SingleType = any;
2
+ type ArrayType = SingleType[];
3
+ type Type = SingleType | ArrayType;
4
+ interface IAbstractFunctor<A extends Type> {
5
+ map(f: (value: A) => Type): IAbstractFunctor<Type>;
6
+ flatMap(f: (value: A) => IAbstractFunctor<Type>): IAbstractFunctor<Type>;
7
+ }
8
+ interface IFunctor<A extends Type> extends IAbstractFunctor<A> {
9
+ map<B extends Type>(f: (value: A) => B): IFunctor<B>;
10
+ flatMap<B extends Type>(f: (value: A) => IFunctor<B>): IFunctor<B>;
11
+ }
12
+ interface IArrayFunctor<A extends ArrayType> extends IAbstractFunctor<A> {
13
+ map<U extends ArrayType>(f: (value: A) => U): IArrayFunctor<U>;
14
+ flatMap<U extends ArrayType>(f: (value: A) => IArrayFunctor<U>): IArrayFunctor<U>;
15
+ }
16
+
17
+ export { ArrayType, IAbstractFunctor, IArrayFunctor, IFunctor, SingleType, Type };
@@ -0,0 +1,17 @@
1
+ type SingleType = any;
2
+ type ArrayType = SingleType[];
3
+ type Type = SingleType | ArrayType;
4
+ interface IAbstractFunctor<A extends Type> {
5
+ map(f: (value: A) => Type): IAbstractFunctor<Type>;
6
+ flatMap(f: (value: A) => IAbstractFunctor<Type>): IAbstractFunctor<Type>;
7
+ }
8
+ interface IFunctor<A extends Type> extends IAbstractFunctor<A> {
9
+ map<B extends Type>(f: (value: A) => B): IFunctor<B>;
10
+ flatMap<B extends Type>(f: (value: A) => IFunctor<B>): IFunctor<B>;
11
+ }
12
+ interface IArrayFunctor<A extends ArrayType> extends IAbstractFunctor<A> {
13
+ map<U extends ArrayType>(f: (value: A) => U): IArrayFunctor<U>;
14
+ flatMap<U extends ArrayType>(f: (value: A) => IArrayFunctor<U>): IArrayFunctor<U>;
15
+ }
16
+
17
+ export { ArrayType, IAbstractFunctor, IArrayFunctor, IFunctor, SingleType, Type };
@@ -0,0 +1 @@
1
+ "use strict";
File without changes
@@ -0,0 +1,33 @@
1
+ import { Type, IFunctor } from './functor/index.mjs';
2
+ import { ITraversable } from './index.mjs';
3
+
4
+ interface IOption<T extends Type> extends IFunctor<T>, ITraversable<T> {
5
+ get(): T;
6
+ getOrElse(defaultValue: T): T;
7
+ orElse(alternative: IOption<T>): IOption<T>;
8
+ map<U extends Type>(f: (value: T) => U): IOption<U>;
9
+ flatMap<U extends Type>(f: (value: T) => IOption<U>): IOption<U>;
10
+ toList(): IIterable<T>;
11
+ }
12
+
13
+ interface IIterable<A extends Type> extends IFunctor<A> {
14
+ count(p: (x: A) => boolean): number;
15
+ find(p: (a: A) => boolean): IOption<A>;
16
+ forEach(f: (a: A) => void): void;
17
+ exists(p: (a: A) => boolean): Boolean;
18
+ filter(p: (a: A) => boolean): IIterable<A>;
19
+ filterNot(p: (a: A) => boolean): IIterable<A>;
20
+ reduce(f: (b: A, a: A) => A): A;
21
+ reduceRight(f: (b: A, a: A) => A): A;
22
+ foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
23
+ foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
24
+ get head(): A;
25
+ get headOption(): IOption<A>;
26
+ get isEmpty(): boolean;
27
+ map<B extends Type>(f: (a: A) => B): IIterable<B>;
28
+ flatMap<B extends Type>(f: (a: A) => IIterable<B>): IIterable<B>;
29
+ get size(): number;
30
+ toArray(): readonly A[];
31
+ }
32
+
33
+ export { IOption as I, IIterable as a };
@@ -0,0 +1,15 @@
1
+ import { a as IIterable } from './index-18491592.js';
2
+ import { IList } from './list/IList.mjs';
3
+
4
+ interface ISet<T> extends IIterable<T>, ICollection<T> {
5
+ has(value: T): boolean;
6
+ }
7
+
8
+ interface IConverters<A> {
9
+ toList(): IList<A>;
10
+ toSet(): ISet<A>;
11
+ }
12
+ interface ICollection<A> extends IConverters<A> {
13
+ }
14
+
15
+ export { ISet as I, ICollection as a, IConverters as b };
@@ -0,0 +1,33 @@
1
+ import { Type, IFunctor } from './functor/index.js';
2
+ import { ITraversable } from './index.js';
3
+
4
+ interface IOption<T extends Type> extends IFunctor<T>, ITraversable<T> {
5
+ get(): T;
6
+ getOrElse(defaultValue: T): T;
7
+ orElse(alternative: IOption<T>): IOption<T>;
8
+ map<U extends Type>(f: (value: T) => U): IOption<U>;
9
+ flatMap<U extends Type>(f: (value: T) => IOption<U>): IOption<U>;
10
+ toList(): IIterable<T>;
11
+ }
12
+
13
+ interface IIterable<A extends Type> extends IFunctor<A> {
14
+ count(p: (x: A) => boolean): number;
15
+ find(p: (a: A) => boolean): IOption<A>;
16
+ forEach(f: (a: A) => void): void;
17
+ exists(p: (a: A) => boolean): Boolean;
18
+ filter(p: (a: A) => boolean): IIterable<A>;
19
+ filterNot(p: (a: A) => boolean): IIterable<A>;
20
+ reduce(f: (b: A, a: A) => A): A;
21
+ reduceRight(f: (b: A, a: A) => A): A;
22
+ foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
23
+ foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
24
+ get head(): A;
25
+ get headOption(): IOption<A>;
26
+ get isEmpty(): boolean;
27
+ map<B extends Type>(f: (a: A) => B): IIterable<B>;
28
+ flatMap<B extends Type>(f: (a: A) => IIterable<B>): IIterable<B>;
29
+ get size(): number;
30
+ toArray(): readonly A[];
31
+ }
32
+
33
+ export { IOption as I, IIterable as a };
@@ -0,0 +1,15 @@
1
+ import { a as IIterable } from './index-64357013.js';
2
+ import { IList } from './list/IList.js';
3
+
4
+ interface ISet<T> extends IIterable<T>, ICollection<T> {
5
+ has(value: T): boolean;
6
+ }
7
+
8
+ interface IConverters<A> {
9
+ toList(): IList<A>;
10
+ toSet(): ISet<A>;
11
+ }
12
+ interface ICollection<A> extends IConverters<A> {
13
+ }
14
+
15
+ export { ISet as I, ICollection as a, IConverters as b };
package/dist/index.d.mts CHANGED
@@ -1,117 +1,13 @@
1
- import { ParseError } from './error/ParseError.mjs';
1
+ import { Type, IFunctor } from './functor/index.mjs';
2
2
 
3
- declare class Left<L, R> implements Either<L, R> {
4
- value: L;
5
- constructor(value: L);
6
- isLeft(): this is Left<L, R>;
7
- isRight(): this is Right<L, R>;
8
- map<U>(_f: (value: R) => U): Either<L, U>;
9
- flatMap<U>(_f: (value: R) => Either<L, U>): Either<L, U>;
10
- toOption(): Option<R>;
11
- toList(): List<R>;
3
+ interface ITraversable<A extends Type> extends IFunctor<A> {
4
+ get size(): number;
5
+ get isEmpty(): boolean;
6
+ contains(value: A): boolean;
7
+ reduce(f: (b: A, a: A) => A): A;
8
+ reduceRight(f: (b: A, a: A) => A): A;
9
+ foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
10
+ foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
12
11
  }
13
12
 
14
- declare class Right<L, R> implements Either<L, R> {
15
- value: R;
16
- constructor(value: R);
17
- isLeft(): this is Left<L, R>;
18
- isRight(): this is Right<L, R>;
19
- map<U>(f: (value: R) => U): Either<L, U>;
20
- flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
21
- toOption(): Option<R>;
22
- toList(): List<R>;
23
- }
24
-
25
- interface Either<L, R> extends IFunctor<R> {
26
- value: L | R;
27
- isLeft(): this is Left<L, R>;
28
- isRight(): this is Right<L, R>;
29
- map<U>(f: (value: R) => U): Either<L, U>;
30
- flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
31
- toOption(): Option<R>;
32
- toList(): List<R>;
33
- }
34
- declare const left: <L, R>(value: L) => Either<L, R>;
35
- declare const right: <L, R>(value: R) => Either<L, R>;
36
- declare const parseNumber: (input: string) => Either<ParseError, number>;
37
-
38
- declare class List<T> implements IList<T> {
39
- private readonly items;
40
- constructor(items?: T[]);
41
- readonly [n: number]: T;
42
- isEmpty(): boolean;
43
- get length(): number;
44
- add(item: T): List<T>;
45
- removeAt(index: number): List<T>;
46
- get(index: number): T | undefined;
47
- toArray(): readonly T[];
48
- map<U>(f: (value: T) => U): List<U>;
49
- flatMap<U>(f: (value: T) => List<U>): List<U>;
50
- reduce<U>(f: (acc: U, value: T) => U): U;
51
- foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
52
- foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
53
- concat(other: List<T>): List<T>;
54
- toString(): string;
55
- }
56
-
57
- interface IList<T> extends IFunctor<T>, ITraversable<T>, ArrayLike<T> {
58
- map<U>(f: (value: T) => U): IList<U>;
59
- flatMap<U>(f: (value: T) => IList<U>): IList<U>;
60
- reduce<U>(f: (acc: U, value: T) => U): U;
61
- foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
62
- foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
63
- }
64
- declare const list: <T>(items: T[] | undefined) => List<T>;
65
-
66
- declare class Some<T> implements Option<T> {
67
- private value;
68
- constructor(value: T);
69
- isEmpty(): boolean;
70
- get(): T;
71
- getOrElse(defaultValue: T): T;
72
- orElse(alternative: Option<T>): Option<T>;
73
- map<U>(f: (value: T) => U): Option<U>;
74
- flatMap<U>(f: (value: T) => Option<U>): Option<U>;
75
- reduce<U>(f: (acc: U, value: T) => U): U;
76
- foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
77
- foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
78
- toList(): List<T>;
79
- }
80
-
81
- declare class None<T> implements Option<T> {
82
- isEmpty(): boolean;
83
- get(): T;
84
- getOrElse(defaultValue: T): T;
85
- orElse(alternative: Option<T>): Option<T>;
86
- map<U>(f: (value: T) => U): Option<U>;
87
- flatMap<U>(f: (value: T) => Option<U>): Option<U>;
88
- reduce<U>(f: (acc: U, value: T) => U): U;
89
- foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
90
- foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
91
- toList(): List<T>;
92
- }
93
-
94
- interface Option<T> extends IFunctor<T>, ITraversable<T> {
95
- get(): T;
96
- getOrElse(defaultValue: T): T;
97
- orElse(alternative: Option<T>): Option<T>;
98
- map<U>(f: (value: T) => U): Option<U>;
99
- flatMap<U>(f: (value: T) => Option<U>): Option<U>;
100
- toList(): List<T>;
101
- }
102
- declare const option: <T>(value?: T | undefined) => Option<T>;
103
- declare const some: <T>(value: T) => Option<T>;
104
- declare const none: <T>() => Option<T>;
105
-
106
- interface IFunctor<T> {
107
- map<U>(f: (value: T) => U): IFunctor<U>;
108
- flatMap<U>(f: (value: T) => IFunctor<U>): IFunctor<U>;
109
- }
110
- interface ITraversable<T> {
111
- isEmpty(): boolean;
112
- reduce<U>(f: (acc: U, value: T) => U): U;
113
- foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
114
- foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
115
- }
116
-
117
- export { Either, IFunctor, IList, ITraversable, Left, List, None, Option, Right, Some, left, list, none, option, parseNumber, right, some };
13
+ export { ITraversable };