functype 0.8.26 → 0.8.28

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 (55) hide show
  1. package/dist/chunk-N3XKNMEM.mjs +1 -0
  2. package/dist/chunk-QWZYGC4Y.js +1 -0
  3. package/dist/collections/index.d.mts +1 -1
  4. package/dist/collections/index.d.ts +1 -1
  5. package/dist/either/Either.d.mts +1 -1
  6. package/dist/either/Either.d.ts +1 -1
  7. package/dist/either/Either.js +1 -1
  8. package/dist/either/Either.mjs +1 -1
  9. package/dist/either/EitherT.d.mts +1 -1
  10. package/dist/either/EitherT.d.ts +1 -1
  11. package/dist/either/EitherT.js +1 -1
  12. package/dist/either/EitherT.mjs +1 -1
  13. package/dist/{index-BWBqO3Kp.d.mts → index-2z-XZnA_.d.mts} +4 -1
  14. package/dist/{index-DQD4k2t3.d.ts → index-CrlPZG8_.d.ts} +4 -1
  15. package/dist/index.d.mts +1 -1
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/index.mjs +1 -1
  19. package/dist/iterable/Seq.d.mts +1 -1
  20. package/dist/iterable/Seq.d.ts +1 -1
  21. package/dist/iterable/Seq.js +1 -1
  22. package/dist/iterable/Seq.mjs +1 -1
  23. package/dist/iterable/index.d.mts +1 -1
  24. package/dist/iterable/index.d.ts +1 -1
  25. package/dist/iterable/index.js +1 -1
  26. package/dist/iterable/index.mjs +1 -1
  27. package/dist/list/List.d.mts +1 -1
  28. package/dist/list/List.d.ts +1 -1
  29. package/dist/list/List.js +1 -1
  30. package/dist/list/List.mjs +1 -1
  31. package/dist/map/Map.d.mts +1 -1
  32. package/dist/map/Map.d.ts +1 -1
  33. package/dist/map/Map.js +1 -1
  34. package/dist/map/Map.mjs +1 -1
  35. package/dist/option/Option.d.mts +1 -1
  36. package/dist/option/Option.d.ts +1 -1
  37. package/dist/option/Option.js +1 -1
  38. package/dist/option/Option.mjs +1 -1
  39. package/dist/set/Set.d.mts +1 -1
  40. package/dist/set/Set.d.ts +1 -1
  41. package/dist/set/Set.js +1 -1
  42. package/dist/set/Set.mjs +1 -1
  43. package/dist/try/Try.d.mts +1 -1
  44. package/dist/try/Try.d.ts +1 -1
  45. package/dist/try/Try.js +1 -1
  46. package/dist/try/Try.mjs +1 -1
  47. package/dist/util/index.d.mts +1 -1
  48. package/dist/util/index.d.ts +1 -1
  49. package/dist/util/index.js +1 -1
  50. package/dist/util/index.mjs +1 -1
  51. package/lib/either/Either.d.ts +3 -0
  52. package/package.json +5 -5
  53. package/dist/chunk-HGAOWVBI.js +0 -1
  54. package/dist/chunk-NJJ3CNH5.mjs +0 -1
  55. package/lib/either/AsyncEither.d.ts +0 -10
@@ -0,0 +1 @@
1
+ import{a as v}from"./chunk-2I2NKDFN.mjs";import{a as R}from"./chunk-RRAIFS3D.mjs";import{a as U}from"./chunk-377WQNCB.mjs";import{a as b}from"./chunk-HA5XD5KC.mjs";import X from"safe-stable-stringify";import V from"safe-stable-stringify";import G from"safe-stable-stringify";import D from"safe-stable-stringify";var y=e=>{let t=R(e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t),i="Seq";return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},_tag:i,map:o=>y(r.map(o)),flatMap:o=>y(r.flatMap(n=>o(n).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>y(r.filter(o)),filterNot:o=>y(r.filter(n=>!o(n))),find:o=>c(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?c(r[0]):d()},get isEmpty(){return r.length===0},get size(){return r.length},toArray:()=>[...r],reduce:o=>r.reduce(o),reduceRight:o=>r.reduceRight(o),foldLeft:o=>n=>r.reduce(n,o),foldRight:o=>n=>r.reduceRight((u,x)=>n(x,u),o),toString:()=>`Seq(${D(e)})`,toValue:()=>({_tag:i,value:r})}},T=e=>y(e);var h=e=>{let t=R(e)?new b(e):new b(e?.toArray()??[]),r=T(t),i={...r,add:o=>h([...t,o]),remove:o=>{let n=new b(t);return n.delete(o),h(n)},contains:o=>t.has(o),has:o=>t.has(o),map:o=>h(r.map(o)),flatMap:o=>h(r.flatMap(o)),toList:()=>f(t),toSet:()=>i,toString:()=>`Set(${Array.from(t).toString()})`};return i},E=e=>h(e);var m=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],i=T(r),o={...i,_tag:"List",length:r.length,map:n=>m(r.map(n)),flatMap:n=>m(i.flatMap(n)),remove:n=>{let u=r.indexOf(n);return o.removeAt(u)},contains:n=>r.includes(n),add:n=>m([...r,n]),removeAt:n=>n<0||n>=r.length?o:m([...r.slice(0,n),...r.slice(n+1)]),get:n=>c(r[n]),concat:n=>m([...r,...n.toArray()]),toList:()=>o,toSet:()=>E(r),toValue:()=>({_tag:"List",value:r}),toString:()=>`List(${G(f(r))})`};return new Proxy(o,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},f=e=>m(e),H=e=>m(e);console.assert(H);var O=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>p(t(e)),mapAsync:t=>t(e).then(r=>p(r)).catch(r=>s(r)),merge:t=>t.isLeft()?s(t.value):p([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>L(e),toList:()=>f([e]),toString:()=>`Right(${V(e)})`,[Symbol.iterator]:function*(){yield e}}),K=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),merge:t=>s(e),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>d(),toList:()=>f(),toString:()=>`Left(${V(e)})`,[Symbol.iterator]:function*(){}}),p=e=>O(e),s=e=>K(e),B=e=>e.isRight(),I=e=>e.isLeft(),Be=(e,t)=>{try{return p(e())}catch(r){return s(t(r))}},J=e=>O(e);console.assert(J);var Q=e=>K(e);console.assert(Q);var xe=async(e,t)=>{try{let r=await e();return p(r)}catch(r){return s(t(r))}},Se=(e,t)=>{try{return p(e())}catch(r){return s(t(r))}};function S(e){return{value:e,map(t){let r=e.then(i=>{if(B(i))try{let o=t(i.value);return p(o)}catch(o){return s(o)}else return s(i.value)});return S(r)},flatMap(t){let r=e.then(i=>{if(B(i))try{return t(i.value).value}catch(o){return Promise.resolve(s(o))}else return Promise.resolve(s(i.value))});return S(r)},mapLeft(t){let r=e.then(i=>{if(I(i))try{let o=t(i.value);return s(o)}catch(o){return s(o)}else return p(i.value)});return S(r)},fold(t,r){return e.then(i=>B(i)?r(i.value):t(i.value))}}}var A=e=>{let t={values:new U(e)},r=()=>Array.from(t.values.entries()).map(([a,l])=>v([a,l])),i=a=>A(new U(t.values).set(a.toArray()[0],a.toArray()[1]).entries()),o=a=>{let l=new U(t.values);return l.delete(a)?A(l.entries()):A(t.values.entries())},n=a=>t.values.get(a[0])===a[1],u=()=>t.values.size,x=a=>A(Array.from(t.values.entries()).map(([l,j])=>[l,a(j)])),P=a=>{let l=A(t.values.entries()).toList();return A(l.flatMap(a).toArray())},q=a=>T(r()).reduce(a),k=a=>T(r()).reduceRight(a),z=a=>l=>T(r()).foldLeft(a)(l),N=a=>l=>T(r()).foldRight(a)(l),F=a=>c(t.values.get(a)),C=(a,l)=>c(t.values.get(a)).getOrElse(l),$=()=>t.values.size===0;return{add:i,remove:o,contains:n,get size(){return u()},map:x,flatMap:P,reduce:q,reduceRight:k,foldLeft:z,foldRight:N,get:F,getOrElse:C,get isEmpty(){return $()},orElse:(a,l)=>c(t.values.get(a)).orElse(l),toList:()=>f(r()),toSet:()=>E(r()),toString:()=>`Map(${r().toString()})`}},Ne=e=>A(e);import M from"safe-stable-stringify";var w=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>w(e),orThrow:t=>e,toEither:()=>p(e),map:t=>W(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${M(e)})`}),_=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>s(e),map:t=>_(e),flatMap:t=>_(e),toString:()=>`Failure(${M(e)}))`}),W=e=>{try{return w(e())}catch(t){return _(t instanceof Error?t:new Error(String(t)))}};var L=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>L(e),map:t=>L(t(e)),filter(t){return t(e)?L(e):g},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>f([e]),contains:t=>t===e,size:1,toEither:t=>p(e),toString:()=>`Some(${X(e)})`,toValue:()=>({_tag:"Some",value:e})}),g={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>g,filter(e){return g},flatMap:e=>g,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>f([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},d=()=>g,c=e=>e!=null?L(e):d();export{L as a,d as b,c,y as d,T as e,E as f,f as g,H as h,p as i,s as j,B as k,I as l,Be as m,J as n,Q as o,xe as p,Se as q,S as r,Ne as s,W as t};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var _safestablestringify = require('safe-stable-stringify'); var _safestablestringify2 = _interopRequireDefault(_safestablestringify);var y=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t),i="Seq";return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},_tag:i,map:o=>y(r.map(o)),flatMap:o=>y(r.flatMap(n=>o(n).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>y(r.filter(o)),filterNot:o=>y(r.filter(n=>!o(n))),find:o=>c(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?c(r[0]):d()},get isEmpty(){return r.length===0},get size(){return r.length},toArray:()=>[...r],reduce:o=>r.reduce(o),reduceRight:o=>r.reduceRight(o),foldLeft:o=>n=>r.reduce(n,o),foldRight:o=>n=>r.reduceRight((u,x)=>n(x,u),o),toString:()=>`Seq(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:i,value:r})}},T= exports.e =e=>y(e);var h=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?new (0, _chunk3VJERXBPjs.a)(e):new (0, _chunk3VJERXBPjs.a)(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _2 => _2.toArray, 'call', _3 => _3()]), () => ([]))),r=T(t),i={...r,add:o=>h([...t,o]),remove:o=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(o),h(n)},contains:o=>t.has(o),has:o=>t.has(o),map:o=>h(r.map(o)),flatMap:o=>h(r.flatMap(o)),toList:()=>f(t),toSet:()=>i,toString:()=>`Set(${Array.from(t).toString()})`};return i},E= exports.f =e=>h(e);var m=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],i=T(r),o={...i,_tag:"List",length:r.length,map:n=>m(r.map(n)),flatMap:n=>m(i.flatMap(n)),remove:n=>{let u=r.indexOf(n);return o.removeAt(u)},contains:n=>r.includes(n),add:n=>m([...r,n]),removeAt:n=>n<0||n>=r.length?o:m([...r.slice(0,n),...r.slice(n+1)]),get:n=>c(r[n]),concat:n=>m([...r,...n.toArray()]),toList:()=>o,toSet:()=>E(r),toValue:()=>({_tag:"List",value:r}),toString:()=>`List(${_safestablestringify2.default.call(void 0, f(r))})`};return new Proxy(o,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},f= exports.g =e=>m(e),H= exports.h =e=>m(e);console.assert(H);var O=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>p(t(e)),mapAsync:t=>t(e).then(r=>p(r)).catch(r=>s(r)),merge:t=>t.isLeft()?s(t.value):p([e,t.value]),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>L(e),toList:()=>f([e]),toString:()=>`Right(${_safestablestringify2.default.call(void 0, e)})`,[Symbol.iterator]:function*(){yield e}}),K=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),merge:t=>s(e),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>d(),toList:()=>f(),toString:()=>`Left(${_safestablestringify2.default.call(void 0, e)})`,[Symbol.iterator]:function*(){}}),p= exports.i =e=>O(e),s= exports.j =e=>K(e),B= exports.k =e=>e.isRight(),I= exports.l =e=>e.isLeft(),Be= exports.m =(e,t)=>{try{return p(e())}catch(r){return s(t(r))}},J= exports.n =e=>O(e);console.assert(J);var Q=e=>K(e);console.assert(Q);var xe=async(e,t)=>{try{let r=await e();return p(r)}catch(r){return s(t(r))}},Se= exports.q =(e,t)=>{try{return p(e())}catch(r){return s(t(r))}};function S(e){return{value:e,map(t){let r=e.then(i=>{if(B(i))try{let o=t(i.value);return p(o)}catch(o){return s(o)}else return s(i.value)});return S(r)},flatMap(t){let r=e.then(i=>{if(B(i))try{return t(i.value).value}catch(o){return Promise.resolve(s(o))}else return Promise.resolve(s(i.value))});return S(r)},mapLeft(t){let r=e.then(i=>{if(I(i))try{let o=t(i.value);return s(o)}catch(o){return s(o)}else return p(i.value)});return S(r)},fold(t,r){return e.then(i=>B(i)?r(i.value):t(i.value))}}}var A=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([a,l])=>_chunkOXLZ6UIZjs.a.call(void 0, [a,l])),i=a=>A(new (0, _chunk5VTXJIR3js.a)(t.values).set(a.toArray()[0],a.toArray()[1]).entries()),o=a=>{let l=new (0, _chunk5VTXJIR3js.a)(t.values);return l.delete(a)?A(l.entries()):A(t.values.entries())},n=a=>t.values.get(a[0])===a[1],u=()=>t.values.size,x=a=>A(Array.from(t.values.entries()).map(([l,j])=>[l,a(j)])),P=a=>{let l=A(t.values.entries()).toList();return A(l.flatMap(a).toArray())},q=a=>T(r()).reduce(a),k=a=>T(r()).reduceRight(a),z=a=>l=>T(r()).foldLeft(a)(l),N=a=>l=>T(r()).foldRight(a)(l),F=a=>c(t.values.get(a)),C=(a,l)=>c(t.values.get(a)).getOrElse(l),$=()=>t.values.size===0;return{add:i,remove:o,contains:n,get size(){return u()},map:x,flatMap:P,reduce:q,reduceRight:k,foldLeft:z,foldRight:N,get:F,getOrElse:C,get isEmpty(){return $()},orElse:(a,l)=>c(t.values.get(a)).orElse(l),toList:()=>f(r()),toSet:()=>E(r()),toString:()=>`Map(${r().toString()})`}},Ne= exports.s =e=>A(e);var w=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>w(e),orThrow:t=>e,toEither:()=>p(e),map:t=>W(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${_safestablestringify2.default.call(void 0, e)})`}),_=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>s(e),map:t=>_(e),flatMap:t=>_(e),toString:()=>`Failure(${_safestablestringify2.default.call(void 0, e)}))`}),W= exports.t =e=>{try{return w(e())}catch(t){return _(t instanceof Error?t:new Error(String(t)))}};var L=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>L(e),map:t=>L(t(e)),filter(t){return t(e)?L(e):g},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>f([e]),contains:t=>t===e,size:1,toEither:t=>p(e),toString:()=>`Some(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:"Some",value:e})}),g={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>g,filter(e){return g},flatMap:e=>g,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>f([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},d= exports.b =()=>g,c= exports.c =e=>e!=null?L(e):d();exports.a = L; exports.b = d; exports.c = c; exports.d = y; exports.e = T; exports.f = E; exports.g = f; exports.h = H; exports.i = p; exports.j = s; exports.k = B; exports.l = I; exports.m = Be; exports.n = J; exports.o = Q; exports.p = xe; exports.q = Se; exports.r = S; exports.s = Ne; exports.t = W;
@@ -1,4 +1,4 @@
1
- export { d as Collection, C as Converters } from '../index-BWBqO3Kp.mjs';
1
+ export { d as Collection, C as Converters } from '../index-2z-XZnA_.mjs';
2
2
  import '../functor/index.mjs';
3
3
  import '../identity/Identity.mjs';
4
4
  import '../tuple/Tuple.mjs';
@@ -1,4 +1,4 @@
1
- export { d as Collection, C as Converters } from '../index-DQD4k2t3.js';
1
+ export { d as Collection, C as Converters } from '../index-CrlPZG8_.js';
2
2
  import '../functor/index.js';
3
3
  import '../identity/Identity.js';
4
4
  import '../tuple/Tuple.js';
@@ -1,5 +1,5 @@
1
1
  import '../functor/index.mjs';
2
- export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from '../index-BWBqO3Kp.mjs';
2
+ export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync, l as tryCatchSync } from '../index-2z-XZnA_.mjs';
3
3
  import '../typeable/Typeable.mjs';
4
4
  import '../identity/Identity.mjs';
5
5
  import '../tuple/Tuple.mjs';
@@ -1,5 +1,5 @@
1
1
  import '../functor/index.js';
2
- export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from '../index-DQD4k2t3.js';
2
+ export { E as Either, f as Left, R as Right, e as TestEither, j as TypeCheckLeft, h as TypeCheckRight, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync, l as tryCatchSync } from '../index-CrlPZG8_.js';
3
3
  import '../typeable/Typeable.js';
4
4
  import '../identity/Identity.js';
5
5
  import '../tuple/Tuple.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Left = _chunkHGAOWVBIjs.j; exports.Right = _chunkHGAOWVBIjs.i; exports.TypeCheckLeft = _chunkHGAOWVBIjs.o; exports.TypeCheckRight = _chunkHGAOWVBIjs.n; exports.isLeft = _chunkHGAOWVBIjs.l; exports.isRight = _chunkHGAOWVBIjs.k; exports.tryCatch = _chunkHGAOWVBIjs.m; exports.tryCatchAsync = _chunkHGAOWVBIjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Left = _chunkQWZYGC4Yjs.j; exports.Right = _chunkQWZYGC4Yjs.i; exports.TypeCheckLeft = _chunkQWZYGC4Yjs.o; exports.TypeCheckRight = _chunkQWZYGC4Yjs.n; exports.isLeft = _chunkQWZYGC4Yjs.l; exports.isRight = _chunkQWZYGC4Yjs.k; exports.tryCatch = _chunkQWZYGC4Yjs.m; exports.tryCatchAsync = _chunkQWZYGC4Yjs.p; exports.tryCatchSync = _chunkQWZYGC4Yjs.q;
@@ -1 +1 @@
1
- import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as Left,a as Right,g as TypeCheckLeft,f as TypeCheckRight,d as isLeft,c as isRight,e as tryCatch,h as tryCatchAsync};
1
+ import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as Left,a as Right,g as TypeCheckLeft,f as TypeCheckRight,d as isLeft,c as isRight,e as tryCatch,h as tryCatchAsync,i as tryCatchSync};
@@ -1,4 +1,4 @@
1
- export { l as EitherT } from '../index-BWBqO3Kp.mjs';
1
+ export { m as EitherT } from '../index-2z-XZnA_.mjs';
2
2
  import '../functor/index.mjs';
3
3
  import '../identity/Identity.mjs';
4
4
  import '../tuple/Tuple.mjs';
@@ -1,4 +1,4 @@
1
- export { l as EitherT } from '../index-DQD4k2t3.js';
1
+ export { m as EitherT } from '../index-CrlPZG8_.js';
2
2
  import '../functor/index.js';
3
3
  import '../identity/Identity.js';
4
4
  import '../tuple/Tuple.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.EitherT = _chunkHGAOWVBIjs.q;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.EitherT = _chunkQWZYGC4Yjs.r;
@@ -1 +1 @@
1
- import{q as a}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as EitherT};
1
+ import{r as a}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as EitherT};
@@ -129,12 +129,14 @@ type Either<L extends Type, R extends Type> = {
129
129
  getOrElse: (defaultValue: R) => R;
130
130
  getOrThrow: () => R;
131
131
  map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
132
+ merge: <L1 extends Type, R1 extends Type>(other: Either<L1, R1>) => Either<L | L1, [R, R1]>;
132
133
  mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
133
134
  flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
134
135
  flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
135
136
  toOption: () => Option<R>;
136
137
  toList: () => List<R>;
137
138
  toString: () => string;
139
+ [Symbol.iterator]: () => Iterator<R>;
138
140
  } & Typeable<"Left" | "Right">;
139
141
  type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R>;
140
142
  declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
@@ -149,6 +151,7 @@ declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (e
149
151
  declare const TypeCheckRight: <L extends Type, R extends Type>(value: R) => TestEither<L, R>;
150
152
  declare const TypeCheckLeft: <L extends Type, R extends Type>(value: L) => TestEither<L, R>;
151
153
  declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
154
+ declare const tryCatchSync: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
152
155
 
153
156
  type EitherT<L, R> = {
154
157
  value: Promise<Either<L, R>>;
@@ -198,4 +201,4 @@ type Traversable<A extends Type> = Functor<A> & {
198
201
  foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
199
202
  };
200
203
 
201
- 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, TestList as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, type TestEither as e, Left as f, isLeft as g, TypeCheckRight as h, isRight as i, TypeCheckLeft as j, tryCatchAsync as k, EitherT as l, Try as m, type Traversable as n, tryCatch as t };
204
+ 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, TestList as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, type TestEither as e, Left as f, isLeft as g, TypeCheckRight as h, isRight as i, TypeCheckLeft as j, tryCatchAsync as k, tryCatchSync as l, EitherT as m, Try as n, type Traversable as o, tryCatch as t };
@@ -129,12 +129,14 @@ type Either<L extends Type, R extends Type> = {
129
129
  getOrElse: (defaultValue: R) => R;
130
130
  getOrThrow: () => R;
131
131
  map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
132
+ merge: <L1 extends Type, R1 extends Type>(other: Either<L1, R1>) => Either<L | L1, [R, R1]>;
132
133
  mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
133
134
  flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
134
135
  flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
135
136
  toOption: () => Option<R>;
136
137
  toList: () => List<R>;
137
138
  toString: () => string;
139
+ [Symbol.iterator]: () => Iterator<R>;
138
140
  } & Typeable<"Left" | "Right">;
139
141
  type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R>;
140
142
  declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
@@ -149,6 +151,7 @@ declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (e
149
151
  declare const TypeCheckRight: <L extends Type, R extends Type>(value: R) => TestEither<L, R>;
150
152
  declare const TypeCheckLeft: <L extends Type, R extends Type>(value: L) => TestEither<L, R>;
151
153
  declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
154
+ declare const tryCatchSync: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
152
155
 
153
156
  type EitherT<L, R> = {
154
157
  value: Promise<Either<L, R>>;
@@ -198,4 +201,4 @@ type Traversable<A extends Type> = Functor<A> & {
198
201
  foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
199
202
  };
200
203
 
201
- 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, TestList as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, type TestEither as e, Left as f, isLeft as g, TypeCheckRight as h, isRight as i, TypeCheckLeft as j, tryCatchAsync as k, EitherT as l, Try as m, type Traversable as n, tryCatch as t };
204
+ 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, TestList as T, type _Iterable_ as _, Seq as a, Set as b, createSeq as c, type Collection as d, type TestEither as e, Left as f, isLeft as g, TypeCheckRight as h, isRight as i, TypeCheckLeft as j, tryCatchAsync as k, tryCatchSync as l, EitherT as m, Try as n, type Traversable as o, tryCatch as t };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.mjs';
2
- export { E as Either, l as EitherT, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList, n as Traversable, m as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from './index-BWBqO3Kp.mjs';
2
+ export { E as Either, m as EitherT, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList, o as Traversable, n as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync, l as tryCatchSync } from './index-2z-XZnA_.mjs';
3
3
  export { Identity } from './identity/Identity.mjs';
4
4
  export { Tuple } from './tuple/Tuple.mjs';
5
5
  export { Typeable } from './typeable/Typeable.mjs';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { AbstractFunctor, ArrayFunctor, ArrayType, Functor, SingleType, Type } from './functor/index.js';
2
- export { E as Either, l as EitherT, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList, n as Traversable, m as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync } from './index-DQD4k2t3.js';
2
+ export { E as Either, m as EitherT, f as Left, L as List, M as Map, N as None, O as Option, R as Right, a as Seq, b as Set, S as Some, e as TestEither, T as TestList, o as Traversable, n as Try, j as TypeCheckLeft, h as TypeCheckRight, _ as _Iterable_, g as isLeft, i as isRight, t as tryCatch, k as tryCatchAsync, l as tryCatchSync } from './index-CrlPZG8_.js';
3
3
  export { Identity } from './identity/Identity.js';
4
4
  export { Tuple } from './tuple/Tuple.js';
5
5
  export { Typeable } from './typeable/Typeable.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('./chunk-HGAOWVBI.js');require('./chunk-3VJERXBP.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-BNNK42JC.js');require('./chunk-5VTXJIR3.js');require('./chunk-XORABVON.js');require('./chunk-K3EKBPQE.js');exports.EitherT = _chunkHGAOWVBIjs.q; exports.Left = _chunkHGAOWVBIjs.j; exports.List = _chunkHGAOWVBIjs.g; exports.Map = _chunkHGAOWVBIjs.r; exports.None = _chunkHGAOWVBIjs.b; exports.Option = _chunkHGAOWVBIjs.c; exports.Right = _chunkHGAOWVBIjs.i; exports.Seq = _chunkHGAOWVBIjs.e; exports.Set = _chunkHGAOWVBIjs.f; exports.Some = _chunkHGAOWVBIjs.a; exports.TestList = _chunkHGAOWVBIjs.h; exports.Try = _chunkHGAOWVBIjs.s; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.TypeCheckLeft = _chunkHGAOWVBIjs.o; exports.TypeCheckRight = _chunkHGAOWVBIjs.n; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkHGAOWVBIjs.l; exports.isRight = _chunkHGAOWVBIjs.k; exports.tryCatch = _chunkHGAOWVBIjs.m; exports.tryCatchAsync = _chunkHGAOWVBIjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('./chunk-QWZYGC4Y.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-BNNK42JC.js');require('./chunk-5VTXJIR3.js');require('./chunk-3VJERXBP.js');require('./chunk-XORABVON.js');require('./chunk-K3EKBPQE.js');exports.EitherT = _chunkQWZYGC4Yjs.r; exports.Left = _chunkQWZYGC4Yjs.j; exports.List = _chunkQWZYGC4Yjs.g; exports.Map = _chunkQWZYGC4Yjs.s; exports.None = _chunkQWZYGC4Yjs.b; exports.Option = _chunkQWZYGC4Yjs.c; exports.Right = _chunkQWZYGC4Yjs.i; exports.Seq = _chunkQWZYGC4Yjs.e; exports.Set = _chunkQWZYGC4Yjs.f; exports.Some = _chunkQWZYGC4Yjs.a; exports.TestList = _chunkQWZYGC4Yjs.h; exports.Try = _chunkQWZYGC4Yjs.t; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.TypeCheckLeft = _chunkQWZYGC4Yjs.o; exports.TypeCheckRight = _chunkQWZYGC4Yjs.n; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkQWZYGC4Yjs.l; exports.isRight = _chunkQWZYGC4Yjs.k; exports.tryCatch = _chunkQWZYGC4Yjs.m; exports.tryCatchAsync = _chunkQWZYGC4Yjs.p; exports.tryCatchSync = _chunkQWZYGC4Yjs.q;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a,b,c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r,s}from"./chunk-NJJ3CNH5.mjs";import"./chunk-HA5XD5KC.mjs";import{a as q}from"./chunk-2I2NKDFN.mjs";import{a as t}from"./chunk-V7DKESTM.mjs";import"./chunk-RRAIFS3D.mjs";import"./chunk-377WQNCB.mjs";import"./chunk-V2J3R5IU.mjs";import"./chunk-2ML63TYF.mjs";export{p as EitherT,i as Left,f as List,r as Map,b as None,c as Option,h as Right,d as Seq,e as Set,a as Some,g as TestList,s as Try,q as Tuple,n as TypeCheckLeft,m as TypeCheckRight,t as Typeable,k as isLeft,j as isRight,l as tryCatch,o as tryCatchAsync};
1
+ import{a,b,c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s,t}from"./chunk-N3XKNMEM.mjs";import{a as r}from"./chunk-2I2NKDFN.mjs";import{a as u}from"./chunk-V7DKESTM.mjs";import"./chunk-RRAIFS3D.mjs";import"./chunk-377WQNCB.mjs";import"./chunk-HA5XD5KC.mjs";import"./chunk-V2J3R5IU.mjs";import"./chunk-2ML63TYF.mjs";export{q as EitherT,i as Left,f as List,s as Map,b as None,c as Option,h as Right,d as Seq,e as Set,a as Some,g as TestList,t as Try,r as Tuple,n as TypeCheckLeft,m as TypeCheckRight,u as Typeable,k as isLeft,j as isRight,l as tryCatch,o as tryCatchAsync,p as tryCatchSync};
@@ -1,4 +1,4 @@
1
- export { a as Seq, c as createSeq } from '../index-BWBqO3Kp.mjs';
1
+ export { a as Seq, c as createSeq } from '../index-2z-XZnA_.mjs';
2
2
  import '../typeable/Typeable.mjs';
3
3
  import '../functor/index.mjs';
4
4
  import '../identity/Identity.mjs';
@@ -1,4 +1,4 @@
1
- export { a as Seq, c as createSeq } from '../index-DQD4k2t3.js';
1
+ export { a as Seq, c as createSeq } from '../index-CrlPZG8_.js';
2
2
  import '../typeable/Typeable.js';
3
3
  import '../functor/index.js';
4
4
  import '../identity/Identity.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Seq = _chunkHGAOWVBIjs.e; exports.createSeq = _chunkHGAOWVBIjs.d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Seq = _chunkQWZYGC4Yjs.e; exports.createSeq = _chunkQWZYGC4Yjs.d;
@@ -1 +1 @@
1
- import{d as a,e as b}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as Seq,a as createSeq};
1
+ import{d as a,e as b}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as Seq,a as createSeq};
@@ -1,5 +1,5 @@
1
1
  import '../functor/index.mjs';
2
- export { a as Seq, _ as _Iterable_ } from '../index-BWBqO3Kp.mjs';
2
+ export { a as Seq, _ as _Iterable_ } from '../index-2z-XZnA_.mjs';
3
3
  import '../identity/Identity.mjs';
4
4
  import '../tuple/Tuple.mjs';
5
5
  import '../typeable/Typeable.mjs';
@@ -1,5 +1,5 @@
1
1
  import '../functor/index.js';
2
- export { a as Seq, _ as _Iterable_ } from '../index-DQD4k2t3.js';
2
+ export { a as Seq, _ as _Iterable_ } from '../index-CrlPZG8_.js';
3
3
  import '../identity/Identity.js';
4
4
  import '../tuple/Tuple.js';
5
5
  import '../typeable/Typeable.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Seq = _chunkHGAOWVBIjs.e;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Seq = _chunkQWZYGC4Yjs.e;
@@ -1 +1 @@
1
- import{e as a}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Seq};
1
+ import{e as a}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Seq};
@@ -1,4 +1,4 @@
1
- export { L as List, T as TestList } from '../index-BWBqO3Kp.mjs';
1
+ export { L as List, T as TestList } from '../index-2z-XZnA_.mjs';
2
2
  import '../typeable/Typeable.mjs';
3
3
  import '../functor/index.mjs';
4
4
  import '../identity/Identity.mjs';
@@ -1,4 +1,4 @@
1
- export { L as List, T as TestList } from '../index-DQD4k2t3.js';
1
+ export { L as List, T as TestList } from '../index-CrlPZG8_.js';
2
2
  import '../typeable/Typeable.js';
3
3
  import '../functor/index.js';
4
4
  import '../identity/Identity.js';
package/dist/list/List.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.List = _chunkHGAOWVBIjs.g; exports.TestList = _chunkHGAOWVBIjs.h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.List = _chunkQWZYGC4Yjs.g; exports.TestList = _chunkQWZYGC4Yjs.h;
@@ -1 +1 @@
1
- import{g as a,h as b}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as List,b as TestList};
1
+ import{g as a,h as b}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as List,b as TestList};
@@ -1,4 +1,4 @@
1
- export { M as Map } from '../index-BWBqO3Kp.mjs';
1
+ export { M as Map } from '../index-2z-XZnA_.mjs';
2
2
  import '../tuple/Tuple.mjs';
3
3
  import '../functor/index.mjs';
4
4
  import '../identity/Identity.mjs';
package/dist/map/Map.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { M as Map } from '../index-DQD4k2t3.js';
1
+ export { M as Map } from '../index-CrlPZG8_.js';
2
2
  import '../tuple/Tuple.js';
3
3
  import '../functor/index.js';
4
4
  import '../identity/Identity.js';
package/dist/map/Map.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Map = _chunkHGAOWVBIjs.r;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Map = _chunkQWZYGC4Yjs.s;
package/dist/map/Map.mjs CHANGED
@@ -1 +1 @@
1
- import{r as a}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Map};
1
+ import{s as a}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Map};
@@ -1,5 +1,5 @@
1
1
  import '../functor/index.mjs';
2
- export { N as None, O as Option, S as Some } from '../index-BWBqO3Kp.mjs';
2
+ export { N as None, O as Option, S as Some } from '../index-2z-XZnA_.mjs';
3
3
  import '../typeable/Typeable.mjs';
4
4
  import '../identity/Identity.mjs';
5
5
  import '../tuple/Tuple.mjs';
@@ -1,5 +1,5 @@
1
1
  import '../functor/index.js';
2
- export { N as None, O as Option, S as Some } from '../index-DQD4k2t3.js';
2
+ export { N as None, O as Option, S as Some } from '../index-CrlPZG8_.js';
3
3
  import '../typeable/Typeable.js';
4
4
  import '../identity/Identity.js';
5
5
  import '../tuple/Tuple.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.None = _chunkHGAOWVBIjs.b; exports.Option = _chunkHGAOWVBIjs.c; exports.Some = _chunkHGAOWVBIjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.None = _chunkQWZYGC4Yjs.b; exports.Option = _chunkQWZYGC4Yjs.c; exports.Some = _chunkQWZYGC4Yjs.a;
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as None,c as Option,a as Some};
1
+ import{a,b,c}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{b as None,c as Option,a as Some};
@@ -1,4 +1,4 @@
1
- export { b as Set } from '../index-BWBqO3Kp.mjs';
1
+ export { b as Set } from '../index-2z-XZnA_.mjs';
2
2
  import '../functor/index.mjs';
3
3
  import '../identity/Identity.mjs';
4
4
  import '../tuple/Tuple.mjs';
package/dist/set/Set.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { b as Set } from '../index-DQD4k2t3.js';
1
+ export { b as Set } from '../index-CrlPZG8_.js';
2
2
  import '../functor/index.js';
3
3
  import '../identity/Identity.js';
4
4
  import '../tuple/Tuple.js';
package/dist/set/Set.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Set = _chunkHGAOWVBIjs.f;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Set = _chunkQWZYGC4Yjs.f;
package/dist/set/Set.mjs CHANGED
@@ -1 +1 @@
1
- import{f as a}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Set};
1
+ import{f as a}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Set};
@@ -1,4 +1,4 @@
1
- export { m as Try } from '../index-BWBqO3Kp.mjs';
1
+ export { n as Try } from '../index-2z-XZnA_.mjs';
2
2
  import '../typeable/Typeable.mjs';
3
3
  import '../functor/index.mjs';
4
4
  import '../identity/Identity.mjs';
package/dist/try/Try.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { m as Try } from '../index-DQD4k2t3.js';
1
+ export { n as Try } from '../index-CrlPZG8_.js';
2
2
  import '../typeable/Typeable.js';
3
3
  import '../functor/index.js';
4
4
  import '../identity/Identity.js';
package/dist/try/Try.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Try = _chunkHGAOWVBIjs.s;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');exports.Try = _chunkQWZYGC4Yjs.t;
package/dist/try/Try.mjs CHANGED
@@ -1 +1 @@
1
- import{s as a}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Try};
1
+ import{t as a}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";export{a as Try};
@@ -1,4 +1,4 @@
1
- import { E as Either } from '../index-BWBqO3Kp.mjs';
1
+ import { E as Either } from '../index-2z-XZnA_.mjs';
2
2
  import { ParseError } from '../error/ParseError.mjs';
3
3
  import '../functor/index.mjs';
4
4
  import '../identity/Identity.mjs';
@@ -1,4 +1,4 @@
1
- import { E as Either } from '../index-DQD4k2t3.js';
1
+ import { E as Either } from '../index-CrlPZG8_.js';
2
2
  import { ParseError } from '../error/ParseError.js';
3
3
  import '../functor/index.js';
4
4
  import '../identity/Identity.js';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var _chunkHGAOWVBIjs = require('../chunk-HGAOWVBI.js');require('../chunk-3VJERXBP.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkHGAOWVBIjs.j.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkHGAOWVBIjs.i.call(void 0, r)};exports.parseNumber = a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var _chunkQWZYGC4Yjs = require('../chunk-QWZYGC4Y.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');require('../chunk-K3EKBPQE.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkQWZYGC4Yjs.j.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkQWZYGC4Yjs.i.call(void 0, r)};exports.parseNumber = a;
@@ -1 +1 @@
1
- import{a as s}from"../chunk-VK5GL6NM.mjs";import{i as e,j as t}from"../chunk-NJJ3CNH5.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?t(s(`${r}`)):e(r)};export{a as parseNumber};
1
+ import{a as s}from"../chunk-VK5GL6NM.mjs";import{i as e,j as t}from"../chunk-N3XKNMEM.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";import"../chunk-2ML63TYF.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?t(s(`${r}`)):e(r)};export{a as parseNumber};
@@ -10,12 +10,14 @@ export type Either<L extends Type, R extends Type> = {
10
10
  getOrElse: (defaultValue: R) => R;
11
11
  getOrThrow: () => R;
12
12
  map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
13
+ merge: <L1 extends Type, R1 extends Type>(other: Either<L1, R1>) => Either<L | L1, [R, R1]>;
13
14
  mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
14
15
  flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
15
16
  flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
16
17
  toOption: () => Option<R>;
17
18
  toList: () => List<R>;
18
19
  toString: () => string;
20
+ [Symbol.iterator]: () => Iterator<R>;
19
21
  } & Typeable<"Left" | "Right">;
20
22
  export type TestEither<L extends Type, R extends Type> = Either<L, R> & Functor<R>;
21
23
  export declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
@@ -30,3 +32,4 @@ export declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onEr
30
32
  export declare const TypeCheckRight: <L extends Type, R extends Type>(value: R) => TestEither<L, R>;
31
33
  export declare const TypeCheckLeft: <L extends Type, R extends Type>(value: L) => TestEither<L, R>;
32
34
  export declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
35
+ export declare const tryCatchSync: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functype",
3
- "version": "0.8.26",
3
+ "version": "0.8.28",
4
4
  "description": "A smallish functional library for TypeScript",
5
5
  "author": "jordan.burke@gmail.com",
6
6
  "license": "MIT",
@@ -12,13 +12,13 @@
12
12
  "url": "https://github.com/jordanburke/functype",
13
13
  "devDependencies": {
14
14
  "@types/jest": "29.5.13",
15
- "@types/node": "^20.16.5",
16
- "@typescript-eslint/eslint-plugin": "^7.5.0",
17
- "@typescript-eslint/parser": "^7.5.0",
15
+ "@types/node": "^22.7.5",
16
+ "@typescript-eslint/eslint-plugin": "^8.8.1",
17
+ "@typescript-eslint/parser": "^8.8.1",
18
18
  "cross-env": "^7.0.3",
19
19
  "eslint": "^8.57.0",
20
20
  "eslint-config-prettier": "^9.1.0",
21
- "eslint-plugin-import": "^2.30.0",
21
+ "eslint-plugin-import": "^2.31.0",
22
22
  "eslint-plugin-prettier": "^5.2.1",
23
23
  "eslint-plugin-simple-import-sort": "^12.1.1",
24
24
  "jest": "^29.7.0",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _safestablestringify = require('safe-stable-stringify'); var _safestablestringify2 = _interopRequireDefault(_safestablestringify);var y=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t),i="Seq";return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},_tag:i,map:o=>y(r.map(o)),flatMap:o=>y(r.flatMap(n=>o(n).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>y(r.filter(o)),filterNot:o=>y(r.filter(n=>!o(n))),find:o=>A(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?A(r[0]):L()},get isEmpty(){return r.length===0},get size(){return r.length},toArray:()=>[...r],reduce:o=>r.reduce(o),reduceRight:o=>r.reduceRight(o),foldLeft:o=>n=>r.reduce(n,o),foldRight:o=>n=>r.reduceRight((u,x)=>n(x,u),o),toString:()=>`Seq(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:i,value:r})}},T= exports.e =e=>y(e);var g=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?new (0, _chunk3VJERXBPjs.a)(e):new (0, _chunk3VJERXBPjs.a)(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _2 => _2.toArray, 'call', _3 => _3()]), () => ([]))),r=T(t),i={...r,add:o=>g([...t,o]),remove:o=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(o),g(n)},contains:o=>t.has(o),has:o=>t.has(o),map:o=>g(r.map(o)),flatMap:o=>g(r.flatMap(o)),toList:()=>p(t),toSet:()=>i,toString:()=>`Set(${Array.from(t).toString()})`};return i},R= exports.f =e=>g(e);var m=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],i=T(r),o={...i,_tag:"List",length:r.length,map:n=>m(r.map(n)),flatMap:n=>m(i.flatMap(n)),remove:n=>{let u=r.indexOf(n);return o.removeAt(u)},contains:n=>r.includes(n),add:n=>m([...r,n]),removeAt:n=>n<0||n>=r.length?o:m([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>m([...r,...n.toArray()]),toList:()=>o,toSet:()=>R(r),toValue:()=>({_tag:"List",value:r}),toString:()=>`List(${_safestablestringify2.default.call(void 0, p(r))})`};return new Proxy(o,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},p= exports.g =e=>m(e),H= exports.h =e=>m(e);console.assert(H);var O=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>f(t(e)),mapAsync:t=>t(e).then(r=>f(r)).catch(r=>s(r)),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>d(e),toList:()=>p([e]),toString:()=>`Right(${_safestablestringify2.default.call(void 0, e)})`}),K=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>L(),toList:()=>p(),toString:()=>`Left(${_safestablestringify2.default.call(void 0, e)})`}),f= exports.i =e=>O(e),s= exports.j =e=>K(e),B= exports.k =e=>e.isRight(),I= exports.l =e=>e.isLeft(),Be= exports.m =(e,t)=>{try{return f(e())}catch(r){return s(t(r))}},J= exports.n =e=>O(e);console.assert(J);var Q=e=>K(e);console.assert(Q);var xe=async(e,t)=>{try{let r=await e();return f(r)}catch(r){return s(t(r))}};function S(e){return{value:e,map(t){let r=e.then(i=>{if(B(i))try{let o=t(i.value);return f(o)}catch(o){return s(o)}else return s(i.value)});return S(r)},flatMap(t){let r=e.then(i=>{if(B(i))try{return t(i.value).value}catch(o){return Promise.resolve(s(o))}else return Promise.resolve(s(i.value))});return S(r)},mapLeft(t){let r=e.then(i=>{if(I(i))try{let o=t(i.value);return s(o)}catch(o){return s(o)}else return f(i.value)});return S(r)},fold(t,r){return e.then(i=>B(i)?r(i.value):t(i.value))}}}var c=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([a,l])=>_chunkOXLZ6UIZjs.a.call(void 0, [a,l])),i=a=>c(new (0, _chunk5VTXJIR3js.a)(t.values).set(a.toArray()[0],a.toArray()[1]).entries()),o=a=>{let l=new (0, _chunk5VTXJIR3js.a)(t.values);return l.delete(a)?c(l.entries()):c(t.values.entries())},n=a=>t.values.get(a[0])===a[1],u=()=>t.values.size,x=a=>c(Array.from(t.values.entries()).map(([l,j])=>[l,a(j)])),P=a=>{let l=c(t.values.entries()).toList();return c(l.flatMap(a).toArray())},q=a=>T(r()).reduce(a),z=a=>T(r()).reduceRight(a),N=a=>l=>T(r()).foldLeft(a)(l),k=a=>l=>T(r()).foldRight(a)(l),F=a=>A(t.values.get(a)),C=(a,l)=>A(t.values.get(a)).getOrElse(l),$=()=>t.values.size===0;return{add:i,remove:o,contains:n,get size(){return u()},map:x,flatMap:P,reduce:q,reduceRight:z,foldLeft:N,foldRight:k,get:F,getOrElse:C,get isEmpty(){return $()},orElse:(a,l)=>A(t.values.get(a)).orElse(l),toList:()=>p(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},Ne= exports.r =e=>c(e);var w=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>w(e),orThrow:t=>e,toEither:()=>f(e),map:t=>W(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${_safestablestringify2.default.call(void 0, e)})`}),_=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>s(e),map:t=>_(e),flatMap:t=>_(e),toString:()=>`Failure(${_safestablestringify2.default.call(void 0, e)}))`}),W= exports.s =e=>{try{return w(e())}catch(t){return _(t instanceof Error?t:new Error(String(t)))}};var d=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>d(e),map:t=>d(t(e)),filter(t){return t(e)?d(e):h},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>p([e]),contains:t=>t===e,size:1,toEither:t=>f(e),toString:()=>`Some(${_safestablestringify2.default.call(void 0, e)})`,toValue:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>p([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},L= exports.b =()=>h,A= exports.c =e=>e!=null?d(e):L();exports.a = d; exports.b = L; exports.c = A; exports.d = y; exports.e = T; exports.f = R; exports.g = p; exports.h = H; exports.i = f; exports.j = s; exports.k = B; exports.l = I; exports.m = Be; exports.n = J; exports.o = Q; exports.p = xe; exports.q = S; exports.r = Ne; exports.s = W;
@@ -1 +0,0 @@
1
- import{a as U}from"./chunk-HA5XD5KC.mjs";import{a as v}from"./chunk-2I2NKDFN.mjs";import{a as b}from"./chunk-RRAIFS3D.mjs";import{a as E}from"./chunk-377WQNCB.mjs";import G from"safe-stable-stringify";import D from"safe-stable-stringify";var y=e=>{let t=b(e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t),i="Seq";return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},_tag:i,map:o=>y(r.map(o)),flatMap:o=>y(r.flatMap(n=>o(n).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>y(r.filter(o)),filterNot:o=>y(r.filter(n=>!o(n))),find:o=>A(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?A(r[0]):L()},get isEmpty(){return r.length===0},get size(){return r.length},toArray:()=>[...r],reduce:o=>r.reduce(o),reduceRight:o=>r.reduceRight(o),foldLeft:o=>n=>r.reduce(n,o),foldRight:o=>n=>r.reduceRight((u,x)=>n(x,u),o),toString:()=>`Seq(${D(e)})`,toValue:()=>({_tag:i,value:r})}},T=e=>y(e);var g=e=>{let t=b(e)?new U(e):new U(e?.toArray()??[]),r=T(t),i={...r,add:o=>g([...t,o]),remove:o=>{let n=new U(t);return n.delete(o),g(n)},contains:o=>t.has(o),has:o=>t.has(o),map:o=>g(r.map(o)),flatMap:o=>g(r.flatMap(o)),toList:()=>p(t),toSet:()=>i,toString:()=>`Set(${Array.from(t).toString()})`};return i},R=e=>g(e);var m=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],i=T(r),o={...i,_tag:"List",length:r.length,map:n=>m(r.map(n)),flatMap:n=>m(i.flatMap(n)),remove:n=>{let u=r.indexOf(n);return o.removeAt(u)},contains:n=>r.includes(n),add:n=>m([...r,n]),removeAt:n=>n<0||n>=r.length?o:m([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>m([...r,...n.toArray()]),toList:()=>o,toSet:()=>R(r),toValue:()=>({_tag:"List",value:r}),toString:()=>`List(${G(p(r))})`};return new Proxy(o,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},p=e=>m(e),H=e=>m(e);console.assert(H);import V from"safe-stable-stringify";var O=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>f(t(e)),mapAsync:t=>t(e).then(r=>f(r)).catch(r=>s(r)),flatMap:t=>t(e),flatMapAsync:t=>t(e).catch(r=>s(r)),toOption:()=>d(e),toList:()=>p([e]),toString:()=>`Right(${V(e)})`}),K=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>s(e),mapAsync:t=>Promise.resolve(s(e)),flatMap:t=>s(e),flatMapAsync:t=>Promise.resolve(s(e)),toOption:()=>L(),toList:()=>p(),toString:()=>`Left(${V(e)})`}),f=e=>O(e),s=e=>K(e),B=e=>e.isRight(),I=e=>e.isLeft(),Be=(e,t)=>{try{return f(e())}catch(r){return s(t(r))}},J=e=>O(e);console.assert(J);var Q=e=>K(e);console.assert(Q);var xe=async(e,t)=>{try{let r=await e();return f(r)}catch(r){return s(t(r))}};function S(e){return{value:e,map(t){let r=e.then(i=>{if(B(i))try{let o=t(i.value);return f(o)}catch(o){return s(o)}else return s(i.value)});return S(r)},flatMap(t){let r=e.then(i=>{if(B(i))try{return t(i.value).value}catch(o){return Promise.resolve(s(o))}else return Promise.resolve(s(i.value))});return S(r)},mapLeft(t){let r=e.then(i=>{if(I(i))try{let o=t(i.value);return s(o)}catch(o){return s(o)}else return f(i.value)});return S(r)},fold(t,r){return e.then(i=>B(i)?r(i.value):t(i.value))}}}var c=e=>{let t={values:new E(e)},r=()=>Array.from(t.values.entries()).map(([a,l])=>v([a,l])),i=a=>c(new E(t.values).set(a.toArray()[0],a.toArray()[1]).entries()),o=a=>{let l=new E(t.values);return l.delete(a)?c(l.entries()):c(t.values.entries())},n=a=>t.values.get(a[0])===a[1],u=()=>t.values.size,x=a=>c(Array.from(t.values.entries()).map(([l,j])=>[l,a(j)])),P=a=>{let l=c(t.values.entries()).toList();return c(l.flatMap(a).toArray())},q=a=>T(r()).reduce(a),z=a=>T(r()).reduceRight(a),N=a=>l=>T(r()).foldLeft(a)(l),k=a=>l=>T(r()).foldRight(a)(l),F=a=>A(t.values.get(a)),C=(a,l)=>A(t.values.get(a)).getOrElse(l),$=()=>t.values.size===0;return{add:i,remove:o,contains:n,get size(){return u()},map:x,flatMap:P,reduce:q,reduceRight:z,foldLeft:N,foldRight:k,get:F,getOrElse:C,get isEmpty(){return $()},orElse:(a,l)=>A(t.values.get(a)).orElse(l),toList:()=>p(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},Ne=e=>c(e);import M from"safe-stable-stringify";var w=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>w(e),orThrow:t=>e,toEither:()=>f(e),map:t=>W(()=>t(e)),flatMap:t=>t(e),toString:()=>`Success(${M(e)})`}),_=e=>({_tag:"Failure",value:void 0,error:e,isSuccess:()=>!1,isFailure:()=>!0,get:()=>{throw e},getOrElse:t=>t,orElse:t=>t,orThrow:t=>{throw t},toEither:()=>s(e),map:t=>_(e),flatMap:t=>_(e),toString:()=>`Failure(${M(e)}))`}),W=e=>{try{return w(e())}catch(t){return _(t instanceof Error?t:new Error(String(t)))}};import X from"safe-stable-stringify";var d=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>d(e),map:t=>d(t(e)),filter(t){return t(e)?d(e):h},flatMap:t=>t(e),reduce:t=>t(void 0,e),reduceRight:t=>t(void 0,e),foldLeft:t=>r=>r(t,e),foldRight:t=>r=>r(e,t),toList:()=>p([e]),contains:t=>t===e,size:1,toEither:t=>f(e),toString:()=>`Some(${X(e)})`,toValue:()=>({_tag:"Some",value:e})}),h={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>h,filter(e){return h},flatMap:e=>h,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>p([]),contains:()=>!1,size:0,toEither:e=>s(e),toString:()=>"None",toValue:()=>({_tag:"None",value:void 0})},L=()=>h,A=e=>e!=null?d(e):L();export{d as a,L as b,A as c,y as d,T as e,R as f,p as g,H as h,f as i,s as j,B as k,I as l,Be as m,J as n,Q as o,xe as p,S as q,Ne as r,W as s};
@@ -1,10 +0,0 @@
1
- import { Either } from "./Either";
2
- export declare class AsyncEither<L, R> {
3
- private readonly promise;
4
- constructor(promise: Promise<Either<L, R>>);
5
- static fromEither<L, R>(either: Either<L, R>): AsyncEither<L, R>;
6
- static liftPromise<L, R>(promise: Promise<R>): AsyncEither<L, R>;
7
- map<U>(f: (value: R) => U): AsyncEither<L, U>;
8
- flatMap<U>(f: (value: R) => AsyncEither<L, U>): AsyncEither<L, U>;
9
- toPromise(): Promise<Either<L, R>>;
10
- }