functype 0.8.19 → 0.8.20

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-MGOOHJA4.mjs +1 -0
  2. package/dist/chunk-ZT6U462C.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-i5kzqn22.d.ts → index-DEY28JXj.d.ts} +40 -26
  14. package/dist/{index-CZsKzO-N.d.mts → index-DxbBrdj_.d.mts} +40 -26
  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 +39 -26
  52. package/lib/option/Option.d.ts +2 -3
  53. package/package.json +1 -1
  54. package/dist/chunk-BTEQN6BB.mjs +0 -1
  55. package/dist/chunk-RGJRKBXI.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as V}from"./chunk-2I2NKDFN.mjs";import{a as h}from"./chunk-RRAIFS3D.mjs";import{a as B}from"./chunk-377WQNCB.mjs";import{a as b}from"./chunk-HA5XD5KC.mjs";var U=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>U(e),mapAsync:async t=>U(e),flatMap:t=>U(e),flatMapAsync:async t=>U(e),toOption:()=>g(),toList:()=>g().toList(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),v=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>v(t(e)),mapAsync:async t=>v(await t(e)),flatMap:t=>t(e),flatMapAsync:t=>t(e),toOption:()=>c(e),toList:()=>c(e).toList(),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),l=e=>U(e),u=e=>v(e),x=e=>e._tag==="Left",E=e=>e._tag==="Right",W=(e,t)=>{try{return u(e())}catch(r){return l(t(r))}},X=async(e,t)=>{try{let r=await e();return u(r)}catch(r){return l(t(r))}};function _(e){return{value:e,map(t){let r=e.then(o=>{if(E(o))try{let a=t(o.value);return u(a)}catch(a){return l(a)}else return l(o.value)});return _(r)},flatMap(t){let r=e.then(o=>{if(E(o))try{return t(o.value).value}catch(a){return Promise.resolve(l(a))}else return Promise.resolve(l(o.value))});return _(r)},mapLeft(t){let r=e.then(o=>{if(x(o))try{let a=t(o.value);return l(a)}catch(a){return l(a)}else return u(o.value)});return _(r)},fold(t,r){return e.then(o=>E(o)?r(o.value):t(o.value))}}}var d=e=>{let t=h(e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>d(r.map(o)),flatMap:o=>d(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>d(r.filter(o)),filterNot:o=>d(r.filter(a=>!o(a))),find:o=>L(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?L(r[0]):g()},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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,p)=>a(p,n),o),valueOf:()=>({values:r})}},f=e=>d(e);var y=e=>{let t=h(e)?new b(e):new b(e?.toArray()??[]),r=f(t),o={...r,add:a=>y([...t,a]),remove:a=>{let n=new b(t);return n.delete(a),y(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>y(r.map(a)),flatMap:a=>y(r.flatMap(a)),toList:()=>A(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},S=e=>y(e);var T=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=f(r),a={...o,_tag:"List",length:r.length,map:n=>T(r.map(n)),flatMap:n=>T(o.flatMap(n)),remove:n=>{let p=r.indexOf(n);return a.removeAt(p)},contains:n=>r.includes(n),add:n=>T([...r,n]),removeAt:n=>n<0||n>=r.length?a:T([...r.slice(0,n),...r.slice(n+1)]),get:n=>L(r[n]),concat:n=>T([...r,...n.toArray()]),toList:()=>a,toSet:()=>S(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,p){return typeof p=="symbol"||isNaN(Number(p))?n[p]:n.get(Number(p))}})},A=e=>T(e);var m=e=>{let t={values:new B(e)},r=()=>Array.from(t.values.entries()).map(([i,s])=>V([i,s])),o=i=>m(new B(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let s=new B(t.values);return s.delete(i)?m(s.entries()):m(t.values.entries())},n=i=>t.values.get(i[0])===i[1],p=()=>t.values.size,M=i=>m(Array.from(t.values.entries()).map(([s,C])=>[s,i(C)])),I=i=>{let s=m(t.values.entries()).toList();return m(s.flatMap(i).toArray())},w=i=>f(r()).reduce(i),P=i=>f(r()).reduceRight(i),N=i=>s=>f(r()).foldLeft(i)(s),z=i=>s=>f(r()).foldRight(i)(s),F=i=>L(t.values.get(i)),q=(i,s)=>L(t.values.get(i)).getOrElse(s),k=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return p()},map:M,flatMap:I,reduce:w,reduceRight:P,foldLeft:N,foldRight:z,get:F,getOrElse:q,get isEmpty(){return k()},orElse:(i,s)=>L(t.values.get(i)).orElse(s),toList:()=>A(r()),toSet:()=>S(r()),toString:()=>`Map(${r().toString()})`}},ve=e=>m(e);var K=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>K(e),orThrow:t=>e,toEither:()=>u(e),map:t=>$(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),O=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:()=>l(e),map:t=>O(e),flatMap:t=>O(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),$=e=>{try{return K(e())}catch(t){return O(t instanceof Error?t:new Error(String(t)))}};var c=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>c(e),map:t=>c(t(e)),filter(t){return t(e)?c(e):R},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:()=>A([e]),contains:t=>t===e,size:1,toEither:t=>u(e),toString:()=>`Some(${JSON.stringify(e)})`,valueOf:()=>({_tag:"Some",value:e})}),R={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>R,filter(e){return R},flatMap:e=>R,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>A([]),contains:()=>!1,size:0,toEither:e=>l(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},g=()=>R,L=e=>e!=null?c(e):g();export{c as a,g as b,L as c,l as d,u as e,x as f,E as g,W as h,X as i,_ as j,d as k,f as l,S as m,A as n,ve as o,$ as p};
@@ -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 _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunk3VJERXBPjs = require('./chunk-3VJERXBP.js');var U=e=>({_tag:"Left",value:e,isLeft:()=>!0,isRight:()=>!1,getOrElse:t=>t,getOrThrow:()=>{throw e},map:t=>U(e),mapAsync:async t=>U(e),flatMap:t=>U(e),flatMapAsync:async t=>U(e),toOption:()=>g(),toList:()=>g().toList(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),v=e=>({_tag:"Right",value:e,isLeft:()=>!1,isRight:()=>!0,getOrElse:t=>e,getOrThrow:()=>e,map:t=>v(t(e)),mapAsync:async t=>v(await t(e)),flatMap:t=>t(e),flatMapAsync:t=>t(e),toOption:()=>c(e),toList:()=>c(e).toList(),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),l= exports.d =e=>U(e),u= exports.e =e=>v(e),x= exports.f =e=>e._tag==="Left",E= exports.g =e=>e._tag==="Right",W= exports.h =(e,t)=>{try{return u(e())}catch(r){return l(t(r))}},X= exports.i =async(e,t)=>{try{let r=await e();return u(r)}catch(r){return l(t(r))}};function _(e){return{value:e,map(t){let r=e.then(o=>{if(E(o))try{let a=t(o.value);return u(a)}catch(a){return l(a)}else return l(o.value)});return _(r)},flatMap(t){let r=e.then(o=>{if(E(o))try{return t(o.value).value}catch(a){return Promise.resolve(l(a))}else return Promise.resolve(l(o.value))});return _(r)},mapLeft(t){let r=e.then(o=>{if(x(o))try{let a=t(o.value);return l(a)}catch(a){return l(a)}else return u(o.value)});return _(r)},fold(t,r){return e.then(o=>E(o)?r(o.value):t(o.value))}}}var d=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>d(r.map(o)),flatMap:o=>d(r.flatMap(a=>o(a).toArray())),forEach:o=>r.forEach(o),count:o=>r.filter(o).length,exists:o=>r.some(o),filter:o=>d(r.filter(o)),filterNot:o=>d(r.filter(a=>!o(a))),find:o=>L(r.find(o)),get head(){return r[0]},get headOption(){return r.length>0?L(r[0]):g()},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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,p)=>a(p,n),o),valueOf:()=>({values:r})}},f= exports.l =e=>d(e);var y=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=f(t),o={...r,add:a=>y([...t,a]),remove:a=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(a),y(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>y(r.map(a)),flatMap:a=>y(r.flatMap(a)),toList:()=>A(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},S= exports.m =e=>y(e);var T=e=>{function t(n){return n!=null&&typeof n[Symbol.iterator]=="function"}let r=Array.isArray(e)?e:t(e)?Array.from(e):[],o=f(r),a={...o,_tag:"List",length:r.length,map:n=>T(r.map(n)),flatMap:n=>T(o.flatMap(n)),remove:n=>{let p=r.indexOf(n);return a.removeAt(p)},contains:n=>r.includes(n),add:n=>T([...r,n]),removeAt:n=>n<0||n>=r.length?a:T([...r.slice(0,n),...r.slice(n+1)]),get:n=>L(r[n]),concat:n=>T([...r,...n.toArray()]),toList:()=>a,toSet:()=>S(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,p){return typeof p=="symbol"||isNaN(Number(p))?n[p]:n.get(Number(p))}})},A= exports.n =e=>T(e);var m=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([i,s])=>_chunkOXLZ6UIZjs.a.call(void 0, [i,s])),o=i=>m(new (0, _chunk5VTXJIR3js.a)(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let s=new (0, _chunk5VTXJIR3js.a)(t.values);return s.delete(i)?m(s.entries()):m(t.values.entries())},n=i=>t.values.get(i[0])===i[1],p=()=>t.values.size,M=i=>m(Array.from(t.values.entries()).map(([s,C])=>[s,i(C)])),I=i=>{let s=m(t.values.entries()).toList();return m(s.flatMap(i).toArray())},w=i=>f(r()).reduce(i),P=i=>f(r()).reduceRight(i),N=i=>s=>f(r()).foldLeft(i)(s),z=i=>s=>f(r()).foldRight(i)(s),F=i=>L(t.values.get(i)),q=(i,s)=>L(t.values.get(i)).getOrElse(s),k=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return p()},map:M,flatMap:I,reduce:w,reduceRight:P,foldLeft:N,foldRight:z,get:F,getOrElse:q,get isEmpty(){return k()},orElse:(i,s)=>L(t.values.get(i)).orElse(s),toList:()=>A(r()),toSet:()=>S(r()),toString:()=>`Map(${r().toString()})`}},ve= exports.o =e=>m(e);var K=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>K(e),orThrow:t=>e,toEither:()=>u(e),map:t=>$(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),O=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:()=>l(e),map:t=>O(e),flatMap:t=>O(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),$= exports.p =e=>{try{return K(e())}catch(t){return O(t instanceof Error?t:new Error(String(t)))}};var c=e=>({_tag:"Some",value:e,isEmpty:!1,get:()=>e,getOrElse:()=>e,orElse:()=>c(e),map:t=>c(t(e)),filter(t){return t(e)?c(e):R},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:()=>A([e]),contains:t=>t===e,size:1,toEither:t=>u(e),toString:()=>`Some(${JSON.stringify(e)})`,valueOf:()=>({_tag:"Some",value:e})}),R={_tag:"None",value:void 0,isEmpty:!0,get:()=>{throw new Error("Cannot call get() on None")},getOrElse:e=>e,orElse:e=>e,map:e=>R,filter(e){return R},flatMap:e=>R,reduce:()=>{},reduceRight:()=>{},foldLeft:e=>()=>e,foldRight:e=>()=>e,toList:()=>A([]),contains:()=>!1,size:0,toEither:e=>l(e),toString:()=>"None",valueOf:()=>({_tag:"None"})},g= exports.b =()=>R,L= exports.c =e=>e!=null?c(e):g();exports.a = c; exports.b = g; exports.c = L; exports.d = l; exports.e = u; exports.f = x; exports.g = E; exports.h = W; exports.i = X; exports.j = _; exports.k = d; exports.l = f; exports.m = S; exports.n = A; exports.o = ve; exports.p = $;
@@ -1,4 +1,4 @@
1
- export { d as Collection, C as Converters } from '../index-CZsKzO-N.mjs';
1
+ export { d as Collection, C as Converters } from '../index-DxbBrdj_.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-i5kzqn22.js';
1
+ export { d as Collection, C as Converters } from '../index-DEY28JXj.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, e as Left, R as Right, f as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from '../index-CZsKzO-N.mjs';
2
+ export { E as Either, e as Left, R as Right, i as isLeft, f as isRight, t as tryCatch, g as tryCatchAsync } from '../index-DxbBrdj_.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, e as Left, R as Right, f as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from '../index-i5kzqn22.js';
2
+ export { E as Either, e as Left, R as Right, i as isLeft, f as isRight, t as tryCatch, g as tryCatchAsync } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');exports.Left = _chunkRGJRKBXIjs.i; exports.Right = _chunkRGJRKBXIjs.h; exports.isLeft = _chunkRGJRKBXIjs.k; exports.isRight = _chunkRGJRKBXIjs.j; exports.tryCatch = _chunkRGJRKBXIjs.l; exports.tryCatchAsync = _chunkRGJRKBXIjs.m;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Left = _chunkZT6U462Cjs.d; exports.Right = _chunkZT6U462Cjs.e; exports.isLeft = _chunkZT6U462Cjs.f; exports.isRight = _chunkZT6U462Cjs.g; exports.tryCatch = _chunkZT6U462Cjs.h; exports.tryCatchAsync = _chunkZT6U462Cjs.i;
@@ -1 +1 @@
1
- import{h as a,i as b,j as c,k as d,l as e,m as f}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.mjs";export{b as Left,a as Right,d as isLeft,c as isRight,e as tryCatch,f as tryCatchAsync};
1
+ import{d as a,e as b,f as c,g as d,h as e,i as f}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Left,b as Right,c as isLeft,d as isRight,e as tryCatch,f as tryCatchAsync};
@@ -1,4 +1,4 @@
1
- export { h as EitherT } from '../index-CZsKzO-N.mjs';
1
+ export { h as EitherT } from '../index-DxbBrdj_.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 { h as EitherT } from '../index-i5kzqn22.js';
1
+ export { h as EitherT } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');exports.EitherT = _chunkRGJRKBXIjs.n;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.EitherT = _chunkZT6U462Cjs.j;
@@ -1 +1 @@
1
- import{n as a}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.mjs";export{a as EitherT};
1
+ import{j as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as EitherT};
@@ -19,7 +19,7 @@ type Option<T extends Type> = {
19
19
  reduceRight<U>(f: (acc: U, value: T) => U): U;
20
20
  foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
21
21
  foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
22
- toList(): _Iterable_<T>;
22
+ toList(): List<T>;
23
23
  contains(value: T): boolean;
24
24
  size: number;
25
25
  valueOf(): {
@@ -117,37 +117,51 @@ type List<A> = ({
117
117
  } & ArrayLike<A>) & (_Iterable_<A> & Collection<A> & Typeable<"List">);
118
118
  declare const List: <A>(values?: Iterable<A> | _Iterable_<A>) => List<A>;
119
119
 
120
- type Either<L extends Left, R extends Right> = {
121
- readonly _tag: "Left" | "Right";
122
- value: L | R;
123
- isLeft: () => boolean;
124
- isRight: () => boolean;
120
+ type Either<L, R> = Left<L, R> | Right<L, R>;
121
+ type Left<L, R> = {
122
+ readonly _tag: "Left";
123
+ readonly value: L;
124
+ isLeft: () => true;
125
+ isRight: () => false;
125
126
  getOrElse: (defaultValue: R) => R;
126
127
  getOrThrow: () => R;
127
- map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
128
- mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
129
- flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
130
- flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
128
+ map: <U>(f: (value: R) => U) => Left<L, U>;
129
+ mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Left<L, U>>;
130
+ flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Left<L | L1, U>;
131
+ flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Left<L | L1, U>>;
131
132
  toOption: () => Option<R>;
132
133
  toList: () => List<R>;
133
134
  valueOf: () => {
134
- _tag: "Left" | "Right";
135
- value: L | R;
135
+ _tag: "Left";
136
+ value: L;
136
137
  };
137
138
  toString: () => string;
138
- } & (Functor<R> & Typeable<"Left" | "Right">);
139
- type Right = Type;
140
- declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
141
- type Left = Type;
142
- declare const Left: <L extends Type, R extends Type>(value: L) => Either<L, R>;
143
- declare const isRight: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
144
- value: R;
145
- };
146
- declare const isLeft: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
147
- value: L;
148
- };
149
- declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
150
- declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
139
+ } & Typeable<"Left">;
140
+ declare const Left: <L, R>(value: L) => Left<L, R>;
141
+ type Right<L, R> = {
142
+ readonly _tag: "Right";
143
+ readonly value: R;
144
+ isLeft: () => false;
145
+ isRight: () => true;
146
+ getOrElse: (defaultValue: R) => R;
147
+ getOrThrow: () => R;
148
+ map: <U>(f: (value: R) => U) => Right<L, U>;
149
+ mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Right<L, U>>;
150
+ flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Either<L | L1, U>;
151
+ flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Either<L | L1, U>>;
152
+ toOption: () => Option<R>;
153
+ toList: () => List<R>;
154
+ valueOf: () => {
155
+ _tag: "Right";
156
+ value: R;
157
+ };
158
+ toString: () => string;
159
+ } & Functor<R> & Typeable<"Right">;
160
+ declare const Right: <L, R>(value: R) => Right<L, R>;
161
+ declare const isLeft: <L, R>(either: Either<L, R>) => either is Left<L, R>;
162
+ declare const isRight: <L, R>(either: Either<L, R>) => either is Right<L, R>;
163
+ declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
164
+ declare const tryCatchAsync: <L, R>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
151
165
 
152
166
  type EitherT<L, R> = {
153
167
  value: Promise<Either<L, R>>;
@@ -202,4 +216,4 @@ type Traversable<A extends Type> = Functor<A> & {
202
216
  foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
203
217
  };
204
218
 
205
- 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, tryCatchAsync as g, EitherT as h, isRight as i, type Traversable as j, tryCatch as t };
219
+ 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, isRight as f, tryCatchAsync as g, EitherT as h, isLeft as i, type Traversable as j, tryCatch as t };
@@ -19,7 +19,7 @@ type Option<T extends Type> = {
19
19
  reduceRight<U>(f: (acc: U, value: T) => U): U;
20
20
  foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
21
21
  foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
22
- toList(): _Iterable_<T>;
22
+ toList(): List<T>;
23
23
  contains(value: T): boolean;
24
24
  size: number;
25
25
  valueOf(): {
@@ -117,37 +117,51 @@ type List<A> = ({
117
117
  } & ArrayLike<A>) & (_Iterable_<A> & Collection<A> & Typeable<"List">);
118
118
  declare const List: <A>(values?: Iterable<A> | _Iterable_<A>) => List<A>;
119
119
 
120
- type Either<L extends Left, R extends Right> = {
121
- readonly _tag: "Left" | "Right";
122
- value: L | R;
123
- isLeft: () => boolean;
124
- isRight: () => boolean;
120
+ type Either<L, R> = Left<L, R> | Right<L, R>;
121
+ type Left<L, R> = {
122
+ readonly _tag: "Left";
123
+ readonly value: L;
124
+ isLeft: () => true;
125
+ isRight: () => false;
125
126
  getOrElse: (defaultValue: R) => R;
126
127
  getOrThrow: () => R;
127
- map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
128
- mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
129
- flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
130
- flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
128
+ map: <U>(f: (value: R) => U) => Left<L, U>;
129
+ mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Left<L, U>>;
130
+ flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Left<L | L1, U>;
131
+ flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Left<L | L1, U>>;
131
132
  toOption: () => Option<R>;
132
133
  toList: () => List<R>;
133
134
  valueOf: () => {
134
- _tag: "Left" | "Right";
135
- value: L | R;
135
+ _tag: "Left";
136
+ value: L;
136
137
  };
137
138
  toString: () => string;
138
- } & (Functor<R> & Typeable<"Left" | "Right">);
139
- type Right = Type;
140
- declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
141
- type Left = Type;
142
- declare const Left: <L extends Type, R extends Type>(value: L) => Either<L, R>;
143
- declare const isRight: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
144
- value: R;
145
- };
146
- declare const isLeft: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
147
- value: L;
148
- };
149
- declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
150
- declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
139
+ } & Typeable<"Left">;
140
+ declare const Left: <L, R>(value: L) => Left<L, R>;
141
+ type Right<L, R> = {
142
+ readonly _tag: "Right";
143
+ readonly value: R;
144
+ isLeft: () => false;
145
+ isRight: () => true;
146
+ getOrElse: (defaultValue: R) => R;
147
+ getOrThrow: () => R;
148
+ map: <U>(f: (value: R) => U) => Right<L, U>;
149
+ mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Right<L, U>>;
150
+ flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Either<L | L1, U>;
151
+ flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Either<L | L1, U>>;
152
+ toOption: () => Option<R>;
153
+ toList: () => List<R>;
154
+ valueOf: () => {
155
+ _tag: "Right";
156
+ value: R;
157
+ };
158
+ toString: () => string;
159
+ } & Functor<R> & Typeable<"Right">;
160
+ declare const Right: <L, R>(value: R) => Right<L, R>;
161
+ declare const isLeft: <L, R>(either: Either<L, R>) => either is Left<L, R>;
162
+ declare const isRight: <L, R>(either: Either<L, R>) => either is Right<L, R>;
163
+ declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
164
+ declare const tryCatchAsync: <L, R>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
151
165
 
152
166
  type EitherT<L, R> = {
153
167
  value: Promise<Either<L, R>>;
@@ -202,4 +216,4 @@ type Traversable<A extends Type> = Functor<A> & {
202
216
  foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
203
217
  };
204
218
 
205
- 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, tryCatchAsync as g, EitherT as h, isRight as i, type Traversable as j, tryCatch as t };
219
+ 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, isRight as f, tryCatchAsync as g, EitherT as h, isLeft as i, type Traversable as j, 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, h as EitherT, e 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, j as Traversable, T as Try, _ as _Iterable_, f as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-CZsKzO-N.mjs';
2
+ export { E as Either, h as EitherT, e 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, j as Traversable, T as Try, _ as _Iterable_, i as isLeft, f as isRight, t as tryCatch, g as tryCatchAsync } from './index-DxbBrdj_.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, h as EitherT, e 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, j as Traversable, T as Try, _ as _Iterable_, f as isLeft, i as isRight, t as tryCatch, g as tryCatchAsync } from './index-i5kzqn22.js';
2
+ export { E as Either, h as EitherT, e 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, j as Traversable, T as Try, _ as _Iterable_, i as isLeft, f as isRight, t as tryCatch, g as tryCatchAsync } from './index-DEY28JXj.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 _chunkRGJRKBXIjs = require('./chunk-RGJRKBXI.js');require('./chunk-3VJERXBP.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-BNNK42JC.js');require('./chunk-K3EKBPQE.js');require('./chunk-5VTXJIR3.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');require('./chunk-XORABVON.js');exports.EitherT = _chunkRGJRKBXIjs.n; exports.Left = _chunkRGJRKBXIjs.i; exports.List = _chunkRGJRKBXIjs.g; exports.Map = _chunkRGJRKBXIjs.o; exports.None = _chunkRGJRKBXIjs.b; exports.Option = _chunkRGJRKBXIjs.c; exports.Right = _chunkRGJRKBXIjs.h; exports.Seq = _chunkRGJRKBXIjs.e; exports.Set = _chunkRGJRKBXIjs.f; exports.Some = _chunkRGJRKBXIjs.a; exports.Try = _chunkRGJRKBXIjs.p; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkRGJRKBXIjs.k; exports.isRight = _chunkRGJRKBXIjs.j; exports.tryCatch = _chunkRGJRKBXIjs.l; exports.tryCatchAsync = _chunkRGJRKBXIjs.m;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('./chunk-ZT6U462C.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');require('./chunk-BNNK42JC.js');var _chunk5O6YELD3js = require('./chunk-5O6YELD3.js');require('./chunk-K3EKBPQE.js');require('./chunk-5VTXJIR3.js');require('./chunk-3VJERXBP.js');require('./chunk-XORABVON.js');exports.EitherT = _chunkZT6U462Cjs.j; exports.Left = _chunkZT6U462Cjs.d; exports.List = _chunkZT6U462Cjs.n; exports.Map = _chunkZT6U462Cjs.o; exports.None = _chunkZT6U462Cjs.b; exports.Option = _chunkZT6U462Cjs.c; exports.Right = _chunkZT6U462Cjs.e; exports.Seq = _chunkZT6U462Cjs.l; exports.Set = _chunkZT6U462Cjs.m; exports.Some = _chunkZT6U462Cjs.a; exports.Try = _chunkZT6U462Cjs.p; exports.Tuple = _chunkOXLZ6UIZjs.a; exports.Typeable = _chunk5O6YELD3js.a; exports.isLeft = _chunkZT6U462Cjs.f; exports.isRight = _chunkZT6U462Cjs.g; exports.tryCatch = _chunkZT6U462Cjs.h; exports.tryCatchAsync = _chunkZT6U462Cjs.i;
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,p}from"./chunk-BTEQN6BB.mjs";import"./chunk-HA5XD5KC.mjs";import{a as q}from"./chunk-V7DKESTM.mjs";import"./chunk-RRAIFS3D.mjs";import"./chunk-2ML63TYF.mjs";import"./chunk-377WQNCB.mjs";import{a as n}from"./chunk-2I2NKDFN.mjs";import"./chunk-V2J3R5IU.mjs";export{m as EitherT,h as Left,f as List,o as Map,b as None,c as Option,g as Right,d as Seq,e as Set,a as Some,p as Try,n as Tuple,q as Typeable,j as isLeft,i as isRight,k as tryCatch,l as tryCatchAsync};
1
+ import{a,b,c,d,e,f,g,h,i,j,l as k,m as l,n as m,o,p}from"./chunk-MGOOHJA4.mjs";import{a as n}from"./chunk-2I2NKDFN.mjs";import"./chunk-RRAIFS3D.mjs";import{a as q}from"./chunk-V7DKESTM.mjs";import"./chunk-2ML63TYF.mjs";import"./chunk-377WQNCB.mjs";import"./chunk-HA5XD5KC.mjs";import"./chunk-V2J3R5IU.mjs";export{j as EitherT,d as Left,m as List,o as Map,b as None,c as Option,e as Right,k as Seq,l as Set,a as Some,p as Try,n as Tuple,q as Typeable,f as isLeft,g as isRight,h as tryCatch,i as tryCatchAsync};
@@ -1,4 +1,4 @@
1
- export { a as Seq, c as createSeq } from '../index-CZsKzO-N.mjs';
1
+ export { a as Seq, c as createSeq } from '../index-DxbBrdj_.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 { a as Seq, c as createSeq } from '../index-i5kzqn22.js';
1
+ export { a as Seq, c as createSeq } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');exports.Seq = _chunkRGJRKBXIjs.e; exports.createSeq = _chunkRGJRKBXIjs.d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Seq = _chunkZT6U462Cjs.l; exports.createSeq = _chunkZT6U462Cjs.k;
@@ -1 +1 @@
1
- import{d as a,e as b}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.mjs";export{b as Seq,a as createSeq};
1
+ import{k as a,l as b}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.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-CZsKzO-N.mjs';
2
+ export { a as Seq, _ as _Iterable_ } from '../index-DxbBrdj_.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-i5kzqn22.js';
2
+ export { a as Seq, _ as _Iterable_ } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');exports.Seq = _chunkRGJRKBXIjs.e;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Seq = _chunkZT6U462Cjs.l;
@@ -1 +1 @@
1
- import{e as a}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Seq};
1
+ import{l as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Seq};
@@ -1,4 +1,4 @@
1
- export { L as List } from '../index-CZsKzO-N.mjs';
1
+ export { L as List } from '../index-DxbBrdj_.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 } from '../index-i5kzqn22.js';
1
+ export { L as List } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');exports.List = _chunkRGJRKBXIjs.g;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.List = _chunkZT6U462Cjs.n;
@@ -1 +1 @@
1
- import{g as a}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.mjs";export{a as List};
1
+ import{n as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as List};
@@ -1,4 +1,4 @@
1
- export { M as Map } from '../index-CZsKzO-N.mjs';
1
+ export { M as Map } from '../index-DxbBrdj_.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-i5kzqn22.js';
1
+ export { M as Map } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');exports.Map = _chunkRGJRKBXIjs.o;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Map = _chunkZT6U462Cjs.o;
package/dist/map/Map.mjs CHANGED
@@ -1 +1 @@
1
- import{o as a}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Map};
1
+ import{o as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.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-CZsKzO-N.mjs';
2
+ export { N as None, O as Option, S as Some } from '../index-DxbBrdj_.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-i5kzqn22.js';
2
+ export { N as None, O as Option, S as Some } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');exports.None = _chunkRGJRKBXIjs.b; exports.Option = _chunkRGJRKBXIjs.c; exports.Some = _chunkRGJRKBXIjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.None = _chunkZT6U462Cjs.b; exports.Option = _chunkZT6U462Cjs.c; exports.Some = _chunkZT6U462Cjs.a;
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.mjs";export{b as None,c as Option,a as Some};
1
+ import{a,b,c}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{b as None,c as Option,a as Some};
@@ -1,4 +1,4 @@
1
- export { b as Set } from '../index-CZsKzO-N.mjs';
1
+ export { b as Set } from '../index-DxbBrdj_.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-i5kzqn22.js';
1
+ export { b as Set } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');exports.Set = _chunkRGJRKBXIjs.f;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Set = _chunkZT6U462Cjs.m;
package/dist/set/Set.mjs CHANGED
@@ -1 +1 @@
1
- import{f as a}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Set};
1
+ import{m as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Set};
@@ -1,4 +1,4 @@
1
- export { T as Try } from '../index-CZsKzO-N.mjs';
1
+ export { T as Try } from '../index-DxbBrdj_.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 { T as Try } from '../index-i5kzqn22.js';
1
+ export { T as Try } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');exports.Try = _chunkRGJRKBXIjs.p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');exports.Try = _chunkZT6U462Cjs.p;
package/dist/try/Try.mjs CHANGED
@@ -1 +1 @@
1
- import{p as a}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Try};
1
+ import{p as a}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";export{a as Try};
@@ -1,4 +1,4 @@
1
- import { E as Either } from '../index-CZsKzO-N.mjs';
1
+ import { E as Either } from '../index-DxbBrdj_.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-i5kzqn22.js';
1
+ import { E as Either } from '../index-DEY28JXj.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 _chunkRGJRKBXIjs = require('../chunk-RGJRKBXI.js');require('../chunk-3VJERXBP.js');require('../chunk-5O6YELD3.js');require('../chunk-BNNK42JC.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-XORABVON.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkRGJRKBXIjs.i.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkRGJRKBXIjs.h.call(void 0, r)};exports.parseNumber = a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE6RS47F7js = require('../chunk-E6RS47F7.js');var _chunkZT6U462Cjs = require('../chunk-ZT6U462C.js');require('../chunk-OXLZ6UIZ.js');require('../chunk-BNNK42JC.js');require('../chunk-5O6YELD3.js');require('../chunk-K3EKBPQE.js');require('../chunk-5VTXJIR3.js');require('../chunk-3VJERXBP.js');require('../chunk-XORABVON.js');var a=o=>{let r=parseInt(o,10);return isNaN(r)?_chunkZT6U462Cjs.d.call(void 0, _chunkE6RS47F7js.a.call(void 0, `${r}`)):_chunkZT6U462Cjs.e.call(void 0, r)};exports.parseNumber = a;
@@ -1 +1 @@
1
- import{a as s}from"../chunk-VK5GL6NM.mjs";import{h as e,i as t}from"../chunk-BTEQN6BB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-V2J3R5IU.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{d as e,e as t}from"../chunk-MGOOHJA4.mjs";import"../chunk-2I2NKDFN.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-V7DKESTM.mjs";import"../chunk-2ML63TYF.mjs";import"../chunk-377WQNCB.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-V2J3R5IU.mjs";var a=o=>{let r=parseInt(o,10);return isNaN(r)?e(s(`${r}`)):t(r)};export{a as parseNumber};
@@ -1,36 +1,49 @@
1
- import { Functor, Type } from "../functor";
1
+ import { Functor } from "../functor";
2
2
  import { List } from "../list/List";
3
3
  import { Option } from "../option/Option";
4
4
  import { Typeable } from "../typeable/Typeable";
5
- type Right = Type;
6
- type Left = Type;
7
- export type Either<L extends Left, R extends Right> = {
8
- readonly _tag: "Left" | "Right";
9
- value: L | R;
10
- isLeft: () => boolean;
11
- isRight: () => boolean;
5
+ export type Left<L, R> = {
6
+ readonly _tag: "Left";
7
+ readonly value: L;
8
+ isLeft: () => true;
9
+ isRight: () => false;
12
10
  getOrElse: (defaultValue: R) => R;
13
11
  getOrThrow: () => R;
14
- map: <U extends Type>(f: (value: R) => U) => Either<L, U>;
15
- mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>;
16
- flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>;
17
- flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>;
12
+ map: <U>(f: (value: R) => U) => Left<L, U>;
13
+ mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Left<L, U>>;
14
+ flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Left<L | L1, U>;
15
+ flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Left<L | L1, U>>;
18
16
  toOption: () => Option<R>;
19
17
  toList: () => List<R>;
20
18
  valueOf: () => {
21
- _tag: "Left" | "Right";
22
- value: L | R;
19
+ _tag: "Left";
20
+ value: L;
23
21
  };
24
22
  toString: () => string;
25
- } & (Functor<R> & Typeable<"Left" | "Right">);
26
- export declare const Right: <L extends Type, R extends Type>(value: R) => Either<L, R>;
27
- export declare const Left: <L extends Type, R extends Type>(value: L) => Either<L, R>;
28
- export declare const isRight: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
29
- value: R;
30
- };
31
- export declare const isLeft: <L extends Type, R extends Type>(either: Either<L, R>) => either is Either<L, R> & {
32
- value: L;
33
- };
34
- export declare const tryCatch: <L extends Type, R extends Type>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
35
- export declare const tryCatchAsync: <L extends Type, R extends Type>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
36
- export {};
23
+ } & Typeable<"Left">;
24
+ export type Right<L, R> = {
25
+ readonly _tag: "Right";
26
+ readonly value: R;
27
+ isLeft: () => false;
28
+ isRight: () => true;
29
+ getOrElse: (defaultValue: R) => R;
30
+ getOrThrow: () => R;
31
+ map: <U>(f: (value: R) => U) => Right<L, U>;
32
+ mapAsync: <U>(f: (value: R) => Promise<U>) => Promise<Right<L, U>>;
33
+ flatMap: <L1, U>(f: (value: R) => Either<L1, U>) => Either<L | L1, U>;
34
+ flatMapAsync: <L1, U>(f: (value: R) => Promise<Either<L1, U>>) => Promise<Either<L | L1, U>>;
35
+ toOption: () => Option<R>;
36
+ toList: () => List<R>;
37
+ valueOf: () => {
38
+ _tag: "Right";
39
+ value: R;
40
+ };
41
+ toString: () => string;
42
+ } & Functor<R> & Typeable<"Right">;
43
+ export type Either<L, R> = Left<L, R> | Right<L, R>;
44
+ export declare const Left: <L, R>(value: L) => Left<L, R>;
45
+ export declare const Right: <L, R>(value: R) => Right<L, R>;
46
+ export declare const isLeft: <L, R>(either: Either<L, R>) => either is Left<L, R>;
47
+ export declare const isRight: <L, R>(either: Either<L, R>) => either is Right<L, R>;
48
+ export declare const tryCatch: <L, R>(f: () => R, onError: (error: unknown) => L) => Either<L, R>;
49
+ export declare const tryCatchAsync: <L, R>(f: () => Promise<R>, onError: (error: unknown) => L) => Promise<Either<L, R>>;
@@ -1,6 +1,5 @@
1
1
  import { Functor, Type } from "../functor";
2
- import { Either, Traversable } from "../index";
3
- import { _Iterable_ } from "../iterable";
2
+ import { Either, List, Traversable } from "../index";
4
3
  import { Typeable } from "../typeable/Typeable";
5
4
  export type Option<T extends Type> = {
6
5
  readonly _tag: "Some" | "None";
@@ -16,7 +15,7 @@ export type Option<T extends Type> = {
16
15
  reduceRight<U>(f: (acc: U, value: T) => U): U;
17
16
  foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B;
18
17
  foldRight<B>(z: B): (op: (a: T, b: B) => B) => B;
19
- toList(): _Iterable_<T>;
18
+ toList(): List<T>;
20
19
  contains(value: T): boolean;
21
20
  size: number;
22
21
  valueOf(): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functype",
3
- "version": "0.8.19",
3
+ "version": "0.8.20",
4
4
  "description": "A smallish functional library for TypeScript",
5
5
  "author": "jordan.burke@gmail.com",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- import{a as b}from"./chunk-HA5XD5KC.mjs";import{a as U}from"./chunk-RRAIFS3D.mjs";import{a as E}from"./chunk-377WQNCB.mjs";import{a as x}from"./chunk-2I2NKDFN.mjs";var y=e=>{let t=U(e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>y(r.map(o)),flatMap:o=>y(r.flatMap(a=>o(a).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(a=>!o(a))),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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,u)=>a(u,n),o),valueOf:()=>({values:r})}},p=e=>y(e);var g=e=>{let t=U(e)?new b(e):new b(e?.toArray()??[]),r=p(t),o={...r,add:a=>g([...t,a]),remove:a=>{let n=new b(t);return n.delete(a),g(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>g(r.map(a)),flatMap:a=>g(r.flatMap(a)),toList:()=>c(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},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):[],o=p(r),a={...o,_tag:"List",length:r.length,map:n=>m(r.map(n)),flatMap:n=>m(o.flatMap(n)),remove:n=>{let u=r.indexOf(n);return a.removeAt(u)},contains:n=>r.includes(n),add:n=>m([...r,n]),removeAt:n=>n<0||n>=r.length?a:m([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>m([...r,...n.toArray()]),toList:()=>a,toSet:()=>R(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},c=e=>m(e);var k=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:()=>c([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),C=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:()=>c(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),f=e=>k(e),s=e=>C(e),B=e=>e.isRight(),_=e=>e.isLeft(),Te=(e,t)=>{try{return f(e())}catch(r){return s(t(r))}},me=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(o=>{if(B(o))try{let a=t(o.value);return f(a)}catch(a){return s(a)}else return s(o.value)});return S(r)},flatMap(t){let r=e.then(o=>{if(B(o))try{return t(o.value).value}catch(a){return Promise.resolve(s(a))}else return Promise.resolve(s(o.value))});return S(r)},mapLeft(t){let r=e.then(o=>{if(_(o))try{let a=t(o.value);return s(a)}catch(a){return s(a)}else return f(o.value)});return S(r)},fold(t,r){return e.then(o=>B(o)?r(o.value):t(o.value))}}}var T=e=>{let t={values:new E(e)},r=()=>Array.from(t.values.entries()).map(([i,l])=>x([i,l])),o=i=>T(new E(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let l=new E(t.values);return l.delete(i)?T(l.entries()):T(t.values.entries())},n=i=>t.values.get(i[0])===i[1],u=()=>t.values.size,V=i=>T(Array.from(t.values.entries()).map(([l,q])=>[l,i(q)])),K=i=>{let l=T(t.values.entries()).toList();return T(l.flatMap(i).toArray())},I=i=>p(r()).reduce(i),M=i=>p(r()).reduceRight(i),w=i=>l=>p(r()).foldLeft(i)(l),P=i=>l=>p(r()).foldRight(i)(l),N=i=>A(t.values.get(i)),z=(i,l)=>A(t.values.get(i)).getOrElse(l),F=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return u()},map:V,flatMap:K,reduce:I,reduceRight:M,foldLeft:w,foldRight:P,get:N,getOrElse:z,get isEmpty(){return F()},orElse:(i,l)=>A(t.values.get(i)).orElse(l),toList:()=>c(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},xe=e=>T(e);var O=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>O(e),orThrow:t=>e,toEither:()=>f(e),map:t=>$(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),v=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=>v(e),flatMap:t=>v(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),$=e=>{try{return O(e())}catch(t){return v(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(${JSON.stringify(e)})`,valueOf:()=>({_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",valueOf:()=>({_tag:"None"})},L=()=>h,A=e=>e!=null?d(e):L();export{d as a,L as b,A as c,y as d,p as e,R as f,c as g,f as h,s as i,B as j,_ as k,Te as l,me as m,S as n,xe as o,$ as p};
@@ -1 +0,0 @@
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 _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunkOXLZ6UIZjs = require('./chunk-OXLZ6UIZ.js');var y=e=>{let t=_chunkBNNK42JCjs.a.call(void 0, e)?e:e instanceof Object&&"toArray"in e?e.toArray():[],r=Array.from(t);return{[Symbol.iterator]:()=>r[Symbol.iterator](),get length(){return r.length},map:o=>y(r.map(o)),flatMap:o=>y(r.flatMap(a=>o(a).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(a=>!o(a))),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=>a=>r.reduce(a,o),foldRight:o=>a=>r.reduceRight((n,u)=>a(u,n),o),valueOf:()=>({values:r})}},p= 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=p(t),o={...r,add:a=>g([...t,a]),remove:a=>{let n=new (0, _chunk3VJERXBPjs.a)(t);return n.delete(a),g(n)},contains:a=>t.has(a),has:a=>t.has(a),map:a=>g(r.map(a)),flatMap:a=>g(r.flatMap(a)),toList:()=>c(t),toSet:()=>o,toString:()=>`Set(${Array.from(t).toString()})`};return o},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):[],o=p(r),a={...o,_tag:"List",length:r.length,map:n=>m(r.map(n)),flatMap:n=>m(o.flatMap(n)),remove:n=>{let u=r.indexOf(n);return a.removeAt(u)},contains:n=>r.includes(n),add:n=>m([...r,n]),removeAt:n=>n<0||n>=r.length?a:m([...r.slice(0,n),...r.slice(n+1)]),get:n=>A(r[n]),concat:n=>m([...r,...n.toArray()]),toList:()=>a,toSet:()=>R(r),toString:()=>`List(${r.toString()})`,valueOf:()=>({_tag:"List",values:r})};return new Proxy(a,{get(n,u){return typeof u=="symbol"||isNaN(Number(u))?n[u]:n.get(Number(u))}})},c= exports.g =e=>m(e);var k=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:()=>c([e]),valueOf:()=>({_tag:"Right",value:e}),toString:()=>`Right(${JSON.stringify(e)})`}),C=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:()=>c(),valueOf:()=>({_tag:"Left",value:e}),toString:()=>`Left(${JSON.stringify(e)})`}),f= exports.h =e=>k(e),s= exports.i =e=>C(e),B= exports.j =e=>e.isRight(),_= exports.k =e=>e.isLeft(),Te= exports.l =(e,t)=>{try{return f(e())}catch(r){return s(t(r))}},me= exports.m =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(o=>{if(B(o))try{let a=t(o.value);return f(a)}catch(a){return s(a)}else return s(o.value)});return S(r)},flatMap(t){let r=e.then(o=>{if(B(o))try{return t(o.value).value}catch(a){return Promise.resolve(s(a))}else return Promise.resolve(s(o.value))});return S(r)},mapLeft(t){let r=e.then(o=>{if(_(o))try{let a=t(o.value);return s(a)}catch(a){return s(a)}else return f(o.value)});return S(r)},fold(t,r){return e.then(o=>B(o)?r(o.value):t(o.value))}}}var T=e=>{let t={values:new (0, _chunk5VTXJIR3js.a)(e)},r=()=>Array.from(t.values.entries()).map(([i,l])=>_chunkOXLZ6UIZjs.a.call(void 0, [i,l])),o=i=>T(new (0, _chunk5VTXJIR3js.a)(t.values).set(i.toArray()[0],i.toArray()[1]).entries()),a=i=>{let l=new (0, _chunk5VTXJIR3js.a)(t.values);return l.delete(i)?T(l.entries()):T(t.values.entries())},n=i=>t.values.get(i[0])===i[1],u=()=>t.values.size,V=i=>T(Array.from(t.values.entries()).map(([l,q])=>[l,i(q)])),K=i=>{let l=T(t.values.entries()).toList();return T(l.flatMap(i).toArray())},I=i=>p(r()).reduce(i),M=i=>p(r()).reduceRight(i),w=i=>l=>p(r()).foldLeft(i)(l),P=i=>l=>p(r()).foldRight(i)(l),N=i=>A(t.values.get(i)),z=(i,l)=>A(t.values.get(i)).getOrElse(l),F=()=>t.values.size===0;return{add:o,remove:a,contains:n,get size(){return u()},map:V,flatMap:K,reduce:I,reduceRight:M,foldLeft:w,foldRight:P,get:N,getOrElse:z,get isEmpty(){return F()},orElse:(i,l)=>A(t.values.get(i)).orElse(l),toList:()=>c(r()),toSet:()=>R(r()),toString:()=>`Map(${r().toString()})`}},xe= exports.o =e=>T(e);var O=e=>({_tag:"Success",value:e,error:void 0,isSuccess:()=>!0,isFailure:()=>!1,get:()=>e,getOrElse:t=>e,orElse:t=>O(e),orThrow:t=>e,toEither:()=>f(e),map:t=>$(()=>t(e)),flatMap:t=>t(e),valueOf:()=>({_tag:"Success",value:e}),toString:()=>`Success(${JSON.stringify(e)})`}),v=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=>v(e),flatMap:t=>v(e),valueOf:()=>({_tag:"Failure",error:e}),toString:()=>`Failure(${e.message})`}),$= exports.p =e=>{try{return O(e())}catch(t){return v(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(${JSON.stringify(e)})`,valueOf:()=>({_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",valueOf:()=>({_tag:"None"})},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 = p; exports.f = R; exports.g = c; exports.h = f; exports.i = s; exports.j = B; exports.k = _; exports.l = Te; exports.m = me; exports.n = S; exports.o = xe; exports.p = $;