functype 0.4.1 → 0.8.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 (152) hide show
  1. package/dist/chunk-2I2NKDFN.mjs +1 -0
  2. package/dist/chunk-3Y43FJKZ.mjs +1 -0
  3. package/dist/chunk-4AEODSGH.mjs +1 -0
  4. package/dist/chunk-4PGXHDAS.js +1 -0
  5. package/dist/chunk-E3BAZBU2.js +1 -0
  6. package/dist/chunk-E6RS47F7.js +1 -0
  7. package/dist/chunk-FMHIRYL5.mjs +1 -0
  8. package/dist/chunk-GPS3OL5F.mjs +1 -0
  9. package/dist/chunk-HJAAA6CD.mjs +1 -0
  10. package/dist/chunk-KWPKGISB.js +1 -0
  11. package/dist/chunk-OXLZ6UIZ.js +1 -0
  12. package/dist/chunk-PMZTOIT2.js +1 -0
  13. package/dist/chunk-REXFLQTJ.js +1 -0
  14. package/dist/chunk-TVCOFH5I.js +1 -0
  15. package/dist/chunk-VK5GL6NM.mjs +1 -0
  16. package/dist/chunk-VUD7L2T6.mjs +1 -0
  17. package/dist/chunk-WDHUQRFT.js +1 -0
  18. package/dist/chunk-ZMF3MVW7.mjs +1 -0
  19. package/dist/collections/index.d.mts +1 -1
  20. package/dist/collections/index.d.ts +1 -1
  21. package/dist/either/Either.d.mts +1 -1
  22. package/dist/either/Either.d.ts +1 -1
  23. package/dist/either/Either.js +1 -1
  24. package/dist/either/Either.mjs +1 -1
  25. package/dist/either/index.d.mts +1 -1
  26. package/dist/either/index.d.ts +1 -1
  27. package/dist/either/index.js +1 -1
  28. package/dist/either/index.mjs +1 -1
  29. package/dist/error/ParseError.d.mts +6 -2
  30. package/dist/error/ParseError.d.ts +6 -2
  31. package/dist/error/ParseError.js +1 -1
  32. package/dist/error/ParseError.mjs +1 -1
  33. package/dist/functor/index.d.mts +11 -11
  34. package/dist/functor/index.d.ts +11 -11
  35. package/dist/index-BB5a793T.d.mts +208 -0
  36. package/dist/index-DyWcaZaG.d.ts +208 -0
  37. package/dist/index.d.mts +3 -3
  38. package/dist/index.d.ts +3 -3
  39. package/dist/index.js +1 -1
  40. package/dist/index.mjs +1 -1
  41. package/dist/iterable/Seq.d.mts +1 -1
  42. package/dist/iterable/Seq.d.ts +1 -1
  43. package/dist/iterable/Seq.js +1 -1
  44. package/dist/iterable/Seq.mjs +1 -1
  45. package/dist/iterable/index.d.mts +1 -1
  46. package/dist/iterable/index.d.ts +1 -1
  47. package/dist/iterable/index.js +1 -1
  48. package/dist/iterable/index.mjs +1 -1
  49. package/dist/list/List.d.mts +1 -1
  50. package/dist/list/List.d.ts +1 -1
  51. package/dist/list/List.js +1 -1
  52. package/dist/list/List.mjs +1 -1
  53. package/dist/list/index.d.mts +1 -1
  54. package/dist/list/index.d.ts +1 -1
  55. package/dist/list/index.js +1 -1
  56. package/dist/list/index.mjs +1 -1
  57. package/dist/map/Map.d.mts +1 -1
  58. package/dist/map/Map.d.ts +1 -1
  59. package/dist/map/Map.js +1 -1
  60. package/dist/map/Map.mjs +1 -1
  61. package/dist/map/index.d.mts +1 -1
  62. package/dist/map/index.d.ts +1 -1
  63. package/dist/map/index.js +1 -1
  64. package/dist/map/index.mjs +1 -1
  65. package/dist/map/shim.js +1 -1
  66. package/dist/map/shim.mjs +1 -1
  67. package/dist/option/Option.d.mts +1 -1
  68. package/dist/option/Option.d.ts +1 -1
  69. package/dist/option/Option.js +1 -1
  70. package/dist/option/Option.mjs +1 -1
  71. package/dist/option/index.d.mts +1 -1
  72. package/dist/option/index.d.ts +1 -1
  73. package/dist/option/index.js +1 -1
  74. package/dist/option/index.mjs +1 -1
  75. package/dist/set/Set.d.mts +1 -1
  76. package/dist/set/Set.d.ts +1 -1
  77. package/dist/set/Set.js +1 -1
  78. package/dist/set/Set.mjs +1 -1
  79. package/dist/set/index.d.mts +1 -1
  80. package/dist/set/index.d.ts +1 -1
  81. package/dist/set/index.js +1 -1
  82. package/dist/set/index.mjs +1 -1
  83. package/dist/set/shim.js +1 -1
  84. package/dist/set/shim.mjs +1 -1
  85. package/dist/try/Try.d.mts +1 -1
  86. package/dist/try/Try.d.ts +1 -1
  87. package/dist/try/Try.js +1 -1
  88. package/dist/try/Try.mjs +1 -1
  89. package/dist/try/index.d.mts +1 -1
  90. package/dist/try/index.d.ts +1 -1
  91. package/dist/try/index.js +1 -1
  92. package/dist/try/index.mjs +1 -1
  93. package/dist/tuple/Tuple.d.mts +7 -15
  94. package/dist/tuple/Tuple.d.ts +7 -15
  95. package/dist/tuple/Tuple.js +1 -1
  96. package/dist/tuple/Tuple.mjs +1 -1
  97. package/dist/tuple/index.d.mts +0 -1
  98. package/dist/tuple/index.d.ts +0 -1
  99. package/dist/tuple/index.js +1 -1
  100. package/dist/tuple/index.mjs +1 -1
  101. package/dist/util/index.d.mts +1 -1
  102. package/dist/util/index.d.ts +1 -1
  103. package/dist/util/index.js +1 -1
  104. package/dist/util/index.mjs +1 -1
  105. package/dist/util/isIterable.js +1 -1
  106. package/dist/util/isIterable.mjs +1 -1
  107. package/lib/collections/index.d.ts +6 -6
  108. package/lib/either/Either.d.ts +28 -28
  109. package/lib/either/index.d.ts +1 -1
  110. package/lib/error/ParseError.d.ts +6 -2
  111. package/lib/functor/index.d.ts +10 -10
  112. package/lib/index.d.ts +7 -4
  113. package/lib/iterable/Seq.d.ts +27 -24
  114. package/lib/iterable/index.d.ts +7 -7
  115. package/lib/list/List.d.ts +19 -21
  116. package/lib/list/index.d.ts +4 -3
  117. package/lib/map/Map.d.ts +14 -35
  118. package/lib/map/index.d.ts +1 -1
  119. package/lib/option/Option.d.ts +28 -40
  120. package/lib/option/index.d.ts +6 -5
  121. package/lib/set/Set.d.ts +15 -18
  122. package/lib/set/index.d.ts +1 -1
  123. package/lib/try/Try.d.ts +24 -18
  124. package/lib/try/index.d.ts +1 -1
  125. package/lib/tuple/Tuple.d.ts +6 -13
  126. package/lib/tuple/index.d.ts +5 -1
  127. package/lib/util/index.d.ts +1 -1
  128. package/package.json +6 -6
  129. package/dist/chunk-2XH6TPQK.mjs +0 -1
  130. package/dist/chunk-3APFKSCC.js +0 -1
  131. package/dist/chunk-63PL65AF.js +0 -1
  132. package/dist/chunk-6FZZWNOL.js +0 -1
  133. package/dist/chunk-74TKYQJS.mjs +0 -0
  134. package/dist/chunk-CFYIJKWF.mjs +0 -1
  135. package/dist/chunk-E35CYHY2.mjs +0 -1
  136. package/dist/chunk-HH4VYR73.js +0 -1
  137. package/dist/chunk-HOO2EPER.mjs +0 -1
  138. package/dist/chunk-I4BEM5D2.js +0 -1
  139. package/dist/chunk-J4OZ7K3I.mjs +0 -1
  140. package/dist/chunk-JR557W27.mjs +0 -1
  141. package/dist/chunk-O2XFH626.js +0 -1
  142. package/dist/chunk-R7GOBZSO.mjs +0 -1
  143. package/dist/chunk-RLT5VF56.mjs +0 -1
  144. package/dist/chunk-SKJIJETA.js +0 -1
  145. package/dist/chunk-TYHKMGLC.mjs +0 -1
  146. package/dist/chunk-V5UFW2E4.js +0 -1
  147. package/dist/chunk-XKON5UBC.js +0 -1
  148. package/dist/chunk-XVHCBGUW.js +0 -1
  149. package/dist/chunk-Z2XAS3AB.mjs +0 -1
  150. package/dist/chunk-ZTL76QDL.js +0 -1
  151. package/dist/index-BIu07QR3.d.ts +0 -232
  152. package/dist/index-DC8arpKk.d.mts +0 -232
@@ -0,0 +1 @@
1
+ var n=r=>({map:e=>{let t=e(r);return n(t)},flatMap:e=>e(r),get:e=>r[e],toArray:()=>r,[Symbol.iterator](){let e=0;return{next:()=>e<r.length?{value:r[e++],done:!1}:{value:void 0,done:!0}}}});export{n as a};
@@ -0,0 +1 @@
1
+ import{a as r,b as e}from"./chunk-HJAAA6CD.mjs";var o=t=>e(t),i=t=>r(t);export{o as a,i as b};
@@ -0,0 +1 @@
1
+ import{a as r}from"./chunk-2I2NKDFN.mjs";var t=e=>r(e),T=e=>r(e);export{t as a,T as b};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTVCOFH5Ijs = require('./chunk-TVCOFH5I.js');var o=t=>_chunkTVCOFH5Ijs.b.call(void 0, t),i= exports.b =t=>_chunkTVCOFH5Ijs.a.call(void 0, t);exports.a = o; exports.b = i;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var t=e=>_chunkOXLZ6UIZjs.a.call(void 0, e),T= exports.b =e=>_chunkOXLZ6UIZjs.a.call(void 0, e);exports.a = t; exports.b = T;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var o=e=>{let r=new Error(e);return r.name="ParseError",r};exports.a = o;
@@ -0,0 +1 @@
1
+ import{a as d}from"./chunk-RRAIFS3D.mjs";var A=e=>e?b(e):c(),b=e=>a(e),c=()=>p();var i=e=>{let r=d(e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],t=Array.from(r);return{[Symbol.iterator]:()=>t[Symbol.iterator](),get length(){return t.length},map:o=>i(t.map(o)),flatMap:o=>i(t.flatMap(n=>o(n).toArray())),forEach:o=>t.forEach(o),count:o=>t.filter(o).length,exists:o=>t.some(o),filter:o=>i(t.filter(o)),filterNot:o=>i(t.filter(n=>!o(n))),find:o=>A(t.find(o)),get head(){return t[0]},get headOption(){return t.length>0?A(t[0]):p()},get isEmpty(){return t.length===0},get size(){return t.length},toArray:()=>[...t],reduce:o=>t.reduce(o),reduceRight:o=>t.reduceRight(o),foldLeft:o=>n=>t.reduce(n,o),foldRight:o=>n=>t.reduceRight((T,s)=>n(s,T),o),valueOf:()=>({values:t})}},l=e=>i(e);var a=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>a(e),map:r=>a(r(e)),flatMap:r=>r(e),reduce:r=>r(void 0,e),reduceRight:r=>r(void 0,e),foldLeft:r=>t=>t(r,e),foldRight:r=>t=>t(e,r),toList:()=>l([e]),contains:r=>r===e,size:1,valueOf:()=>({_tag:"Some",value:e}),toString:()=>`Some(${JSON.stringify(e)})`}),f={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:()=>f,flatMap:()=>f,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>l([]),contains:()=>!1,size:0,valueOf:()=>({_tag:"None"}),toString:()=>"None"},p=()=>f,B=e=>e!=null?a(e):p(),I=(e,r)=>e._tag==="Some"?r.Some(e.value):r.None();export{a,p as b,B as c,I as d,A as e,b as f,c as g,i as h,l as i};
@@ -0,0 +1 @@
1
+ import{a as m}from"./chunk-HA5XD5KC.mjs";import{e as p,i as l}from"./chunk-FMHIRYL5.mjs";import{a as c}from"./chunk-RRAIFS3D.mjs";var a=r=>{function A(t){return t!=null&&typeof t[Symbol.iterator]=="function"}let e=Array.isArray(r)?r:A(r)?Array.from(r):[],n=l(e),o={...n,length:e.length,map:t=>a(e.map(t)),flatMap:t=>a(n.flatMap(t)),remove:t=>{let i=e.indexOf(t);return o.removeAt(i)},contains:t=>e.includes(t),add:t=>a([...e,t]),removeAt:t=>t<0||t>=e.length?o:a([...e.slice(0,t),...e.slice(t+1)]),get:t=>p(e[t]),concat:t=>a([...e,...t.toArray()]),toList:()=>o,toSet:()=>f(e),toString:()=>`List(${e.toString()})`};return new Proxy(o,{get(t,i){return typeof i=="symbol"||isNaN(Number(i))?t[i]:t.get(Number(i))}})},S=r=>a(r);var g=r=>S(r);var s=r=>{let A=c(r)?new m(r):new m(r?.toArray()??[]),e=l(A),n={...e,add:o=>s([...A,o]),remove:o=>{let t=new m(A);return t.delete(o),s(t)},contains:o=>A.has(o),has:o=>A.has(o),map:o=>s(e.map(o)),flatMap:o=>s(e.flatMap(o)),toList:()=>S(A),toSet:()=>n,toString:()=>`Set(${Array.from(A).toString()})`};return n},f=r=>s(r);export{f as a,S as b,g as c};
@@ -0,0 +1 @@
1
+ import{b as i}from"./chunk-GPS3OL5F.mjs";import{f as L,g as R}from"./chunk-FMHIRYL5.mjs";var o=t=>({_tag:"Right",value:t,isLeft:()=>!1,isRight:()=>!0,map:e=>o(e(t)),flatMap:e=>e(t),toOption:()=>L(t),toList:()=>i([t]),valueOf:()=>({_tag:"Right",value:t}),toString:()=>`Right(${JSON.stringify(t)})`}),r=t=>({_tag:"Left",value:t,isLeft:()=>!0,isRight:()=>!1,map:e=>r(t),flatMap:e=>r(t),toOption:()=>R(),toList:()=>i(),valueOf:()=>({_tag:"Left",value:t}),toString:()=>`Left(${JSON.stringify(t)})`}),n=t=>o(t),h=t=>r(t),g=t=>t.isRight(),U=t=>t.isLeft(),E=(t,e)=>{try{return n(t())}catch(s){return h(e(s))}},l=(t,e)=>t._tag==="Right"?e.Right(t.value):e.Left(t.value);export{n as a,h as b,g as c,U as d,E as e,l as f};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var _chunkWDHUQRFTjs = require('./chunk-WDHUQRFT.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var a=r=>{function A(t){return t!=null&&typeof t[Symbol.iterator]=="function"}let e=Array.isArray(r)?r:A(r)?Array.from(r):[],n=_chunkWDHUQRFTjs.i.call(void 0, e),o={...n,length:e.length,map:t=>a(e.map(t)),flatMap:t=>a(n.flatMap(t)),remove:t=>{let i=e.indexOf(t);return o.removeAt(i)},contains:t=>e.includes(t),add:t=>a([...e,t]),removeAt:t=>t<0||t>=e.length?o:a([...e.slice(0,t),...e.slice(t+1)]),get:t=>_chunkWDHUQRFTjs.e.call(void 0, e[t]),concat:t=>a([...e,...t.toArray()]),toList:()=>o,toSet:()=>f(e),toString:()=>`List(${e.toString()})`};return new Proxy(o,{get(t,i){return typeof i=="symbol"||isNaN(Number(i))?t[i]:t.get(Number(i))}})},S= exports.b =r=>a(r);var g=r=>S(r);var s=r=>{let A=_chunkBNNK42JCjs.a.call(void 0, r)?new (0, _chunk3VJERXBPjs.a)(r):new (0, _chunk3VJERXBPjs.a)(_nullishCoalesce(_optionalChain([r, 'optionalAccess', _ => _.toArray, 'call', _2 => _2()]), () => ([]))),e=_chunkWDHUQRFTjs.i.call(void 0, A),n={...e,add:o=>s([...A,o]),remove:o=>{let t=new (0, _chunk3VJERXBPjs.a)(A);return t.delete(o),s(t)},contains:o=>A.has(o),has:o=>A.has(o),map:o=>s(e.map(o)),flatMap:o=>s(e.flatMap(o)),toList:()=>S(A),toSet:()=>n,toString:()=>`Set(${Array.from(A).toString()})`};return n},f= exports.a =r=>s(r);exports.a = f; exports.b = S; exports.c = g;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var n=r=>({map:e=>{let t=e(r);return n(t)},flatMap:e=>e(r),get:e=>r[e],toArray:()=>r,[Symbol.iterator](){let e=0;return{next:()=>e<r.length?{value:r[e++],done:!1}:{value:void 0,done:!0}}}});exports.a = n;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTVCOFH5Ijs = require('./chunk-TVCOFH5I.js');var s=r=>({_tag:"Success",value:r,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,getOrElse:e=>r,orElse:e=>s(r),toEither:()=>_chunkTVCOFH5Ijs.a.call(void 0, r),map:e=>l(()=>e(r)),flatMap:e=>e(r),valueOf:()=>({_tag:"Success",value:r}),toString:()=>`Success(${JSON.stringify(r)})`}),a=r=>({_tag:"Failure",value:void 0,error:r,isSuccess:()=>!1,isFailure:()=>!0,getOrElse:e=>e,orElse:e=>e,toEither:()=>_chunkTVCOFH5Ijs.b.call(void 0, r),map:e=>a(r),flatMap:e=>a(r),valueOf:()=>({_tag:"Failure",error:r}),toString:()=>`Failure(${r.message})`}),l= exports.a =r=>{try{return s(r())}catch(e){return a(e instanceof Error?e:new Error(String(e)))}},o= exports.b =(r,e)=>r._tag==="Success"?e.Success(r.value):e.Failure(r.error);exports.a = l; exports.b = o;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunkKWPKGISBjs = require('./chunk-KWPKGISB.js');var _chunkWDHUQRFTjs = require('./chunk-WDHUQRFT.js');var o=n=>{let a={values:new (0, _chunk5VTXJIR3js.a)(n)},r=()=>Array.from(a.values.entries()).map(([e,t])=>_chunkOXLZ6UIZjs.a.call(void 0, [e,t])),i=e=>o(new (0, _chunk5VTXJIR3js.a)(a.values).set(e.toArray()[0],e.toArray()[1]).entries()),c=e=>{let t=new (0, _chunk5VTXJIR3js.a)(a.values);return t.delete(e)?o(t.entries()):o(a.values.entries())},m=e=>a.values.get(e[0])===e[1],f=()=>a.values.size,v=e=>o(Array.from(a.values.entries()).map(([t,O])=>[t,e(O)])),M=e=>{let t=o(a.values.entries()).toList();return o(t.flatMap(e).toArray())},T=e=>_chunkWDHUQRFTjs.i.call(void 0, r()).reduce(e),g=e=>_chunkWDHUQRFTjs.i.call(void 0, r()).reduceRight(e),y=e=>t=>_chunkWDHUQRFTjs.i.call(void 0, r()).foldLeft(e)(t),d=e=>t=>_chunkWDHUQRFTjs.i.call(void 0, r()).foldRight(e)(t),S=e=>_chunkWDHUQRFTjs.c.call(void 0, a.values.get(e)),b=(e,t)=>_chunkWDHUQRFTjs.c.call(void 0, a.values.get(e)).getOrElse(t),E=()=>a.values.size===0;return{add:i,remove:c,contains:m,get size(){return f()},map:v,flatMap:M,reduce:T,reduceRight:g,foldLeft:y,foldRight:d,get:S,getOrElse:b,get isEmpty(){return E()},orElse:(e,t)=>_chunkWDHUQRFTjs.c.call(void 0, a.values.get(e)).orElse(t),toList:()=>_chunkKWPKGISBjs.b.call(void 0, r()),toSet:()=>_chunkKWPKGISBjs.a.call(void 0, r()),toString:()=>`Map(${r().toString()})`}},x= exports.a =n=>o(n);exports.a = x;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKWPKGISBjs = require('./chunk-KWPKGISB.js');var _chunkWDHUQRFTjs = require('./chunk-WDHUQRFT.js');var o=t=>({_tag:"Right",value:t,isLeft:()=>!1,isRight:()=>!0,map:e=>o(e(t)),flatMap:e=>e(t),toOption:()=>_chunkWDHUQRFTjs.f.call(void 0, t),toList:()=>_chunkKWPKGISBjs.b.call(void 0, [t]),valueOf:()=>({_tag:"Right",value:t}),toString:()=>`Right(${JSON.stringify(t)})`}),r=t=>({_tag:"Left",value:t,isLeft:()=>!0,isRight:()=>!1,map:e=>r(t),flatMap:e=>r(t),toOption:()=>_chunkWDHUQRFTjs.g.call(void 0, ),toList:()=>_chunkKWPKGISBjs.b.call(void 0, ),valueOf:()=>({_tag:"Left",value:t}),toString:()=>`Left(${JSON.stringify(t)})`}),n= exports.a =t=>o(t),h= exports.b =t=>r(t),g= exports.c =t=>t.isRight(),U= exports.d =t=>t.isLeft(),E= exports.e =(t,e)=>{try{return n(t())}catch(s){return h(e(s))}},l= exports.f =(t,e)=>t._tag==="Right"?e.Right(t.value):e.Left(t.value);exports.a = n; exports.b = h; exports.c = g; exports.d = U; exports.e = E; exports.f = l;
@@ -0,0 +1 @@
1
+ var o=e=>{let r=new Error(e);return r.name="ParseError",r};export{o as a};
@@ -0,0 +1 @@
1
+ import{a as u}from"./chunk-2I2NKDFN.mjs";import{a as s}from"./chunk-377WQNCB.mjs";import{a as V,b as K}from"./chunk-GPS3OL5F.mjs";import{c as p,i as l}from"./chunk-FMHIRYL5.mjs";var o=n=>{let a={values:new s(n)},r=()=>Array.from(a.values.entries()).map(([e,t])=>u([e,t])),i=e=>o(new s(a.values).set(e.toArray()[0],e.toArray()[1]).entries()),c=e=>{let t=new s(a.values);return t.delete(e)?o(t.entries()):o(a.values.entries())},m=e=>a.values.get(e[0])===e[1],f=()=>a.values.size,v=e=>o(Array.from(a.values.entries()).map(([t,O])=>[t,e(O)])),M=e=>{let t=o(a.values.entries()).toList();return o(t.flatMap(e).toArray())},T=e=>l(r()).reduce(e),g=e=>l(r()).reduceRight(e),y=e=>t=>l(r()).foldLeft(e)(t),d=e=>t=>l(r()).foldRight(e)(t),S=e=>p(a.values.get(e)),b=(e,t)=>p(a.values.get(e)).getOrElse(t),E=()=>a.values.size===0;return{add:i,remove:c,contains:m,get size(){return f()},map:v,flatMap:M,reduce:T,reduceRight:g,foldLeft:y,foldRight:d,get:S,getOrElse:b,get isEmpty(){return E()},orElse:(e,t)=>p(a.values.get(e)).orElse(t),toList:()=>K(r()),toSet:()=>V(r()),toString:()=>`Map(${r().toString()})`}},x=n=>o(n);export{x as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var A=e=>e?b(e):c(),b= exports.f =e=>a(e),c= exports.g =()=>p();var i=e=>{let r=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],t=Array.from(r);return{[Symbol.iterator]:()=>t[Symbol.iterator](),get length(){return t.length},map:o=>i(t.map(o)),flatMap:o=>i(t.flatMap(n=>o(n).toArray())),forEach:o=>t.forEach(o),count:o=>t.filter(o).length,exists:o=>t.some(o),filter:o=>i(t.filter(o)),filterNot:o=>i(t.filter(n=>!o(n))),find:o=>A(t.find(o)),get head(){return t[0]},get headOption(){return t.length>0?A(t[0]):p()},get isEmpty(){return t.length===0},get size(){return t.length},toArray:()=>[...t],reduce:o=>t.reduce(o),reduceRight:o=>t.reduceRight(o),foldLeft:o=>n=>t.reduce(n,o),foldRight:o=>n=>t.reduceRight((T,s)=>n(s,T),o),valueOf:()=>({values:t})}},l= exports.i =e=>i(e);var a=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>a(e),map:r=>a(r(e)),flatMap:r=>r(e),reduce:r=>r(void 0,e),reduceRight:r=>r(void 0,e),foldLeft:r=>t=>t(r,e),foldRight:r=>t=>t(e,r),toList:()=>l([e]),contains:r=>r===e,size:1,valueOf:()=>({_tag:"Some",value:e}),toString:()=>`Some(${JSON.stringify(e)})`}),f={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:()=>f,flatMap:()=>f,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>l([]),contains:()=>!1,size:0,valueOf:()=>({_tag:"None"}),toString:()=>"None"},p= exports.b =()=>f,B= exports.c =e=>e!=null?a(e):p(),I= exports.d =(e,r)=>e._tag==="Some"?r.Some(e.value):r.None();exports.a = a; exports.b = p; exports.c = B; exports.d = I; exports.e = A; exports.f = b; exports.g = c; exports.h = i; exports.i = l;
@@ -0,0 +1 @@
1
+ import{a as t,b as T}from"./chunk-HJAAA6CD.mjs";var s=r=>({_tag:"Success",value:r,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,getOrElse:e=>r,orElse:e=>s(r),toEither:()=>t(r),map:e=>l(()=>e(r)),flatMap:e=>e(r),valueOf:()=>({_tag:"Success",value:r}),toString:()=>`Success(${JSON.stringify(r)})`}),a=r=>({_tag:"Failure",value:void 0,error:r,isSuccess:()=>!1,isFailure:()=>!0,getOrElse:e=>e,orElse:e=>e,toEither:()=>T(r),map:e=>a(r),flatMap:e=>a(r),valueOf:()=>({_tag:"Failure",error:r}),toString:()=>`Failure(${r.message})`}),l=r=>{try{return s(r())}catch(e){return a(e instanceof Error?e:new Error(String(e)))}},o=(r,e)=>r._tag==="Success"?e.Success(r.value):e.Failure(r.error);export{l as a,o as b};
@@ -1,4 +1,4 @@
1
- export { I as IConverters, e as _Collection } from '../index-DC8arpKk.mjs';
1
+ export { d as Collection, C as Converters } from '../index-BB5a793T.mjs';
2
2
  import '../functor/index.mjs';
3
3
  import '../tuple/Tuple.mjs';
4
4
  import '../tuple/index.mjs';
@@ -1,4 +1,4 @@
1
- export { I as IConverters, e as _Collection } from '../index-BIu07QR3.js';
1
+ export { d as Collection, C as Converters } from '../index-DyWcaZaG.js';
2
2
  import '../functor/index.js';
3
3
  import '../tuple/Tuple.js';
4
4
  import '../tuple/index.js';
@@ -1,4 +1,4 @@
1
- export { E as Either, h as Left, R as Right } from '../index-DC8arpKk.mjs';
2
1
  import '../functor/index.mjs';
2
+ export { E as Either, e as Left, R as Right, f as isLeft, i as isRight, g as match, t as tryCatch } from '../index-BB5a793T.mjs';
3
3
  import '../tuple/Tuple.mjs';
4
4
  import '../tuple/index.mjs';
@@ -1,4 +1,4 @@
1
- export { E as Either, h as Left, R as Right } from '../index-BIu07QR3.js';
2
1
  import '../functor/index.js';
2
+ export { E as Either, e as Left, R as Right, f as isLeft, i as isRight, g as match, t as tryCatch } from '../index-DyWcaZaG.js';
3
3
  import '../tuple/Tuple.js';
4
4
  import '../tuple/index.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHH4VYR73js = require('../chunk-HH4VYR73.js');require('../chunk-XKON5UBC.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-3APFKSCC.js');require('../chunk-BNNK42JC.js');require('../chunk-O2XFH626.js');exports.Left = _chunkHH4VYR73js.b; exports.Right = _chunkHH4VYR73js.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTVCOFH5Ijs = require('../chunk-TVCOFH5I.js');require('../chunk-KWPKGISB.js');require('../chunk-3VJERXBP.js');require('../chunk-WDHUQRFT.js');require('../chunk-BNNK42JC.js');exports.Left = _chunkTVCOFH5Ijs.b; exports.Right = _chunkTVCOFH5Ijs.a; exports.isLeft = _chunkTVCOFH5Ijs.d; exports.isRight = _chunkTVCOFH5Ijs.c; exports.match = _chunkTVCOFH5Ijs.f; exports.tryCatch = _chunkTVCOFH5Ijs.e;
@@ -1 +1 @@
1
- import{a,b}from"../chunk-Z2XAS3AB.mjs";import"../chunk-E35CYHY2.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-TYHKMGLC.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JR557W27.mjs";export{b as Left,a as Right};
1
+ import{a,b,c,d,e,f}from"../chunk-HJAAA6CD.mjs";import"../chunk-GPS3OL5F.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-FMHIRYL5.mjs";import"../chunk-RRAIFS3D.mjs";export{b as Left,a as Right,d as isLeft,c as isRight,f as match,e as tryCatch};
@@ -1,4 +1,4 @@
1
- export { E as Either, h as Left, R as Right, j as left, r as right } from '../index-DC8arpKk.mjs';
1
+ export { E as Either, e as Left, R as Right, h as left, r as right } from '../index-BB5a793T.mjs';
2
2
  import '../functor/index.mjs';
3
3
  import '../tuple/Tuple.mjs';
4
4
  import '../tuple/index.mjs';
@@ -1,4 +1,4 @@
1
- export { E as Either, h as Left, R as Right, j as left, r as right } from '../index-BIu07QR3.js';
1
+ export { E as Either, e as Left, R as Right, h as left, r as right } from '../index-DyWcaZaG.js';
2
2
  import '../functor/index.js';
3
3
  import '../tuple/Tuple.js';
4
4
  import '../tuple/index.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk63PL65AFjs = require('../chunk-63PL65AF.js');var _chunkHH4VYR73js = require('../chunk-HH4VYR73.js');require('../chunk-XKON5UBC.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-3APFKSCC.js');require('../chunk-BNNK42JC.js');require('../chunk-O2XFH626.js');exports.Left = _chunkHH4VYR73js.b; exports.Right = _chunkHH4VYR73js.a; exports.left = _chunk63PL65AFjs.a; exports.right = _chunk63PL65AFjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4PGXHDASjs = require('../chunk-4PGXHDAS.js');var _chunkTVCOFH5Ijs = require('../chunk-TVCOFH5I.js');require('../chunk-KWPKGISB.js');require('../chunk-3VJERXBP.js');require('../chunk-WDHUQRFT.js');require('../chunk-BNNK42JC.js');exports.Left = _chunkTVCOFH5Ijs.b; exports.Right = _chunkTVCOFH5Ijs.a; exports.left = _chunk4PGXHDASjs.a; exports.right = _chunk4PGXHDASjs.b;
@@ -1 +1 @@
1
- import{a as c,b as d}from"../chunk-J4OZ7K3I.mjs";import{a,b}from"../chunk-Z2XAS3AB.mjs";import"../chunk-E35CYHY2.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-TYHKMGLC.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JR557W27.mjs";export{b as Left,a as Right,c as left,d as right};
1
+ import{a as c,b as d}from"../chunk-3Y43FJKZ.mjs";import{a,b}from"../chunk-HJAAA6CD.mjs";import"../chunk-GPS3OL5F.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-FMHIRYL5.mjs";import"../chunk-RRAIFS3D.mjs";export{b as Left,a as Right,c as left,d as right};
@@ -1,4 +1,8 @@
1
- declare class ParseError extends Error {
2
- }
1
+ declare const ParseError: (message?: string) => Error & {
2
+ name: "ParseError";
3
+ };
4
+ type ParseError = Error & {
5
+ name: "ParseError";
6
+ };
3
7
 
4
8
  export { ParseError };
@@ -1,4 +1,8 @@
1
- declare class ParseError extends Error {
2
- }
1
+ declare const ParseError: (message?: string) => Error & {
2
+ name: "ParseError";
3
+ };
4
+ type ParseError = Error & {
5
+ name: "ParseError";
6
+ };
3
7
 
4
8
  export { ParseError };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZTL76QDLjs = require('../chunk-ZTL76QDL.js');require('../chunk-O2XFH626.js');exports.ParseError = _chunkZTL76QDLjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');exports.ParseError = _chunkE6RS47F7js.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-CFYIJKWF.mjs";import"../chunk-JR557W27.mjs";export{a as ParseError};
1
+ import{a}from"../chunk-VK5GL6NM.mjs";export{a as ParseError};
@@ -1,17 +1,17 @@
1
- type SingleType = any;
1
+ type SingleType = unknown;
2
2
  type ArrayType = SingleType[];
3
3
  type Type = SingleType | ArrayType;
4
- type _AbstractFunctor_<A extends Type> = {
5
- map(f: (value: A) => Type): _AbstractFunctor_<Type>;
6
- flatMap(f: (value: A) => _AbstractFunctor_<Type>): _AbstractFunctor_<Type>;
4
+ type AbstractFunctor<A extends Type> = {
5
+ map(f: (value: A) => Type): AbstractFunctor<Type>;
6
+ flatMap(f: (value: A) => AbstractFunctor<Type>): AbstractFunctor<Type>;
7
7
  };
8
- type _Functor_<A extends Type> = _AbstractFunctor_<A> & {
9
- map<B extends Type>(f: (value: A) => B): _Functor_<B>;
10
- flatMap<B extends Type>(f: (value: A) => _Functor_<B>): _Functor_<B>;
8
+ type Functor<A extends Type> = AbstractFunctor<A> & {
9
+ map<B extends Type>(f: (value: A) => B): Functor<B>;
10
+ flatMap<B extends Type>(f: (value: A) => Functor<B>): Functor<B>;
11
11
  };
12
- type _ArrayFunctor_<A extends ArrayType> = _AbstractFunctor_<A> & {
13
- map<U extends ArrayType>(f: (value: A) => U): _ArrayFunctor_<U>;
14
- flatMap<U extends ArrayType>(f: (value: A) => _ArrayFunctor_<U>): _ArrayFunctor_<U>;
12
+ type ArrayFunctor<A extends ArrayType> = AbstractFunctor<A> & {
13
+ map<U extends ArrayType>(f: (value: A) => U): ArrayFunctor<U>;
14
+ flatMap<U extends ArrayType>(f: (value: A) => ArrayFunctor<U>): ArrayFunctor<U>;
15
15
  };
16
16
 
17
- export type { ArrayType, SingleType, Type, _AbstractFunctor_, _ArrayFunctor_, _Functor_ };
17
+ export type { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type };
@@ -1,17 +1,17 @@
1
- type SingleType = any;
1
+ type SingleType = unknown;
2
2
  type ArrayType = SingleType[];
3
3
  type Type = SingleType | ArrayType;
4
- type _AbstractFunctor_<A extends Type> = {
5
- map(f: (value: A) => Type): _AbstractFunctor_<Type>;
6
- flatMap(f: (value: A) => _AbstractFunctor_<Type>): _AbstractFunctor_<Type>;
4
+ type AbstractFunctor<A extends Type> = {
5
+ map(f: (value: A) => Type): AbstractFunctor<Type>;
6
+ flatMap(f: (value: A) => AbstractFunctor<Type>): AbstractFunctor<Type>;
7
7
  };
8
- type _Functor_<A extends Type> = _AbstractFunctor_<A> & {
9
- map<B extends Type>(f: (value: A) => B): _Functor_<B>;
10
- flatMap<B extends Type>(f: (value: A) => _Functor_<B>): _Functor_<B>;
8
+ type Functor<A extends Type> = AbstractFunctor<A> & {
9
+ map<B extends Type>(f: (value: A) => B): Functor<B>;
10
+ flatMap<B extends Type>(f: (value: A) => Functor<B>): Functor<B>;
11
11
  };
12
- type _ArrayFunctor_<A extends ArrayType> = _AbstractFunctor_<A> & {
13
- map<U extends ArrayType>(f: (value: A) => U): _ArrayFunctor_<U>;
14
- flatMap<U extends ArrayType>(f: (value: A) => _ArrayFunctor_<U>): _ArrayFunctor_<U>;
12
+ type ArrayFunctor<A extends ArrayType> = AbstractFunctor<A> & {
13
+ map<U extends ArrayType>(f: (value: A) => U): ArrayFunctor<U>;
14
+ flatMap<U extends ArrayType>(f: (value: A) => ArrayFunctor<U>): ArrayFunctor<U>;
15
15
  };
16
16
 
17
- export type { ArrayType, SingleType, Type, _AbstractFunctor_, _ArrayFunctor_, _Functor_ };
17
+ export type { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type };
@@ -0,0 +1,208 @@
1
+ import { Type, Functor } from './functor/index.mjs';
2
+ import { Tuple } from './tuple/Tuple.mjs';
3
+ import './tuple/index.mjs';
4
+
5
+ declare const Some: <T extends Type>(value: T) => Option<T>;
6
+ declare const None: <T extends Type>() => Option<T>;
7
+ type Option<T extends Type> = {
8
+ readonly _tag: "Some" | "None";
9
+ readonly value: T | undefined;
10
+ isEmpty: boolean;
11
+ get(): T;
12
+ getOrElse(defaultValue: T): T;
13
+ orElse(alternative: Option<T>): Option<T>;
14
+ map<U extends Type>(f: (value: T) => U): Option<U>;
15
+ flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>;
16
+ reduce<U>(f: (acc: U, value: T) => U): U;
17
+ reduceRight<U>(f: (acc: U, value: T) => U): U;
18
+ foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
19
+ foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
20
+ toList(): _Iterable_<T>;
21
+ contains(value: T): boolean;
22
+ size: number;
23
+ valueOf(): {
24
+ _tag: "Some" | "None";
25
+ value?: T;
26
+ };
27
+ toString(): string;
28
+ } & Traversable<T> & Functor<T> & Typeable;
29
+ declare const Option: <T extends Type>(value: T | null | undefined) => Option<T>;
30
+ declare const match$2: <T extends Type, U>(option: Option<T>, patterns: {
31
+ Some: (value: T) => U;
32
+ None: () => U;
33
+ }) => U;
34
+
35
+ declare const option: <T extends Type>(value?: T) => Option<T>;
36
+ declare const some: <T extends Type>(value: T) => Option<T>;
37
+ declare const none: <T extends Type>() => Option<T>;
38
+
39
+ declare const createSeq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
40
+ type Seq<A> = {
41
+ readonly length: number;
42
+ readonly [Symbol.iterator]: () => Iterator<A>;
43
+ map: <B>(f: (a: A) => B) => Seq<B>;
44
+ flatMap: <B>(f: (a: A) => _Iterable_<B>) => Seq<B>;
45
+ forEach: (f: (a: A) => void) => void;
46
+ count: (p: (x: A) => boolean) => number;
47
+ exists: (p: (a: A) => boolean) => boolean;
48
+ filter: (p: (a: A) => boolean) => Seq<A>;
49
+ filterNot: (p: (a: A) => boolean) => Seq<A>;
50
+ find: (p: (a: A) => boolean) => Option<A>;
51
+ readonly head: A;
52
+ readonly headOption: Option<A>;
53
+ readonly isEmpty: boolean;
54
+ readonly size: number;
55
+ toArray: () => A[];
56
+ reduce: (f: (prev: A, curr: A) => A) => A;
57
+ reduceRight: (f: (prev: A, curr: A) => A) => A;
58
+ foldLeft: <B>(z: B) => (op: (b: B, a: A) => B) => B;
59
+ foldRight: <B>(z: B) => (op: (a: A, b: B) => B) => B;
60
+ valueOf: () => {
61
+ values: A[];
62
+ };
63
+ } & _Iterable_<A>;
64
+ declare const Seq: <A>(values?: Iterable<A> | _Iterable_<A>) => Seq<A>;
65
+
66
+ type _Iterable_<A extends Type> = {
67
+ count(p: (x: A) => boolean): number;
68
+ find(p: (a: A) => boolean): Option<A>;
69
+ forEach(f: (a: A) => void): void;
70
+ exists(p: (a: A) => boolean): boolean;
71
+ filter(p: (a: A) => boolean): _Iterable_<A>;
72
+ filterNot(p: (a: A) => boolean): _Iterable_<A>;
73
+ reduce(f: (b: A, a: A) => A): A;
74
+ reduceRight(f: (b: A, a: A) => A): A;
75
+ foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
76
+ foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
77
+ get head(): A;
78
+ get headOption(): Option<A>;
79
+ get isEmpty(): boolean;
80
+ map<B extends Type>(f: (a: A) => B): _Iterable_<B>;
81
+ flatMap<B extends Type>(f: (a: A) => _Iterable_<B> | Iterable<B>): _Iterable_<B>;
82
+ get size(): number;
83
+ toArray(): readonly A[];
84
+ } & Functor<A>;
85
+
86
+ type Set<A> = {
87
+ add: (value: A) => Set<A>;
88
+ remove: (value: A) => Set<A>;
89
+ contains: (value: A) => boolean;
90
+ has: (value: A) => boolean;
91
+ map: <B>(f: (a: A) => B) => Set<B>;
92
+ flatMap: <B>(f: (a: A) => _Iterable_<B>) => Set<B>;
93
+ toList: () => List<A>;
94
+ toSet: () => Set<A>;
95
+ toString: () => string;
96
+ } & _Iterable_<A> & Collection<A>;
97
+ declare const Set: <A>(iterable?: Iterable<A> | _Iterable_<A>) => Set<A>;
98
+
99
+ type Converters<A> = {
100
+ toList(): List<A>;
101
+ toSet(): Set<A>;
102
+ toString(): string;
103
+ };
104
+ type Collection<A> = Converters<A>;
105
+
106
+ type List<A> = {
107
+ add: (item: A) => List<A>;
108
+ map: <B>(f: (a: A) => B) => List<B>;
109
+ flatMap: <B>(f: (a: A) => _Iterable_<B>) => List<B>;
110
+ remove: (value: A) => List<A>;
111
+ contains: (value: A) => boolean;
112
+ removeAt: (index: number) => List<A>;
113
+ get: (index: number) => Option<A>;
114
+ concat: (other: List<A>) => List<A>;
115
+ toList: () => List<A>;
116
+ toSet: () => Set<A>;
117
+ toString: () => string;
118
+ valueOf: () => {
119
+ values: A[];
120
+ };
121
+ } & ArrayLike<A> & _Iterable_<A> & Collection<A>;
122
+ declare const List: <A>(values?: Iterable<A> | _Iterable_<A>) => List<A>;
123
+
124
+ declare const list: <T extends Type>(items: T[] | undefined) => List<T>;
125
+
126
+ type Either<L extends Type, R extends Type> = {
127
+ readonly _tag: "Left" | "Right";
128
+ value: L | R;
129
+ isLeft: () => boolean;
130
+ isRight: () => boolean;
131
+ map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
132
+ flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
133
+ toOption: () => Option<R>;
134
+ toList: () => List<R>;
135
+ valueOf: () => {
136
+ _tag: "Left" | "Right";
137
+ value: L | R;
138
+ };
139
+ toString: () => string;
140
+ } & Functor<R> & Typeable;
141
+ declare const Right: <L, R>(value: R) => Either<L, R>;
142
+ declare const Left: <L, R>(value: L) => Either<L, R>;
143
+ declare const isRight: <L, R>(either: Either<L, R>) => either is Either<L, R> & {
144
+ value: R;
145
+ };
146
+ declare const isLeft: <L, R>(either: Either<L, R>) => either is Either<L, R> & {
147
+ value: L;
148
+ };
149
+ declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
150
+ declare const match$1: <L, R, U>(either: Either<L, R>, patterns: {
151
+ Left: (value: L) => U;
152
+ Right: (value: R) => U;
153
+ }) => U;
154
+
155
+ declare const left: <L, R>(value: L) => Either<L, R>;
156
+ declare const right: <L, R>(value: R) => Either<L, R>;
157
+
158
+ type SafeTraversable<K, V> = Omit<Traversable<Tuple<[K, V]>>, "map" | "flatMap">;
159
+ type Map<K, V> = {
160
+ add(item: Tuple<[K, V]>): Map<K, V>;
161
+ remove(value: K): Map<K, V>;
162
+ map<U>(f: (value: V) => U): Map<K, U>;
163
+ flatMap<K2, V2>(f: (entry: Tuple<[K, V]>) => _Iterable_<[K2, V2]>): Map<K2, V2>;
164
+ get(key: K): Option<V>;
165
+ getOrElse(key: K, defaultValue: V): V;
166
+ orElse(key: K, alternative: Option<V>): Option<V>;
167
+ } & SafeTraversable<K, V> & Collection<Tuple<[K, V]>>;
168
+ declare const Map: <K, V>(entries?: readonly (readonly [K, V])[] | IterableIterator<[K, V]> | null) => Map<K, V>;
169
+
170
+ type Try<T> = {
171
+ readonly _tag: "Success" | "Failure";
172
+ readonly value: T | undefined;
173
+ readonly error: Error | undefined;
174
+ isSuccess: () => boolean;
175
+ isFailure: () => boolean;
176
+ getOrElse: (defaultValue: T) => T;
177
+ orElse: (alternative: Try<T>) => Try<T>;
178
+ toEither: () => Either<Error, T>;
179
+ map: <U>(f: (value: T) => U) => Try<U>;
180
+ flatMap: <U>(f: (value: T) => Try<U>) => Try<U>;
181
+ valueOf: () => {
182
+ _tag: "Success" | "Failure";
183
+ value?: T;
184
+ error?: Error;
185
+ };
186
+ toString: () => string;
187
+ } & Typeable;
188
+ declare const Try: <T>(f: () => T) => Try<T>;
189
+ declare const match: <T, U>(tryValue: Try<T>, patterns: {
190
+ Success: (value: T) => U;
191
+ Failure: (error: Error) => U;
192
+ }) => U;
193
+
194
+ type Traversable<A extends Type> = Functor<A> & {
195
+ get size(): number;
196
+ get isEmpty(): boolean;
197
+ contains(value: A): boolean;
198
+ reduce(f: (b: A, a: A) => A): A;
199
+ reduceRight(f: (b: A, a: A) => A): A;
200
+ foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
201
+ foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
202
+ };
203
+
204
+ type Typeable = {
205
+ _tag: Type;
206
+ };
207
+
208
+ export { type Converters as C, type Either as E, List as L, Map as M, None as N, Option as O, Right as R, Some as S, Try as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, Left as e, isLeft as f, match$1 as g, left as h, isRight as i, match as j, type Traversable as k, list as l, match$2 as m, none as n, option as o, type Typeable as p, right as r, some as s, tryCatch as t };