functype 0.2.1 → 0.4.1
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.
- package/dist/chunk-2XH6TPQK.mjs +1 -0
- package/dist/{chunk-ZTTAUZK3.js → chunk-3APFKSCC.js} +1 -1
- package/dist/chunk-63PL65AF.js +1 -0
- package/dist/chunk-6FZZWNOL.js +1 -0
- package/dist/chunk-E35CYHY2.mjs +1 -0
- package/dist/chunk-HH4VYR73.js +1 -0
- package/dist/chunk-HOO2EPER.mjs +1 -0
- package/dist/chunk-I4BEM5D2.js +1 -0
- package/dist/chunk-J4OZ7K3I.mjs +1 -0
- package/dist/{chunk-U5EUM74A.mjs → chunk-JR557W27.mjs} +1 -1
- package/dist/{chunk-VTKL7OQI.js → chunk-O2XFH626.js} +1 -1
- package/dist/chunk-R7GOBZSO.mjs +1 -0
- package/dist/chunk-RLT5VF56.mjs +1 -0
- package/dist/chunk-SKJIJETA.js +1 -0
- package/dist/{chunk-X52Z6M5P.mjs → chunk-TYHKMGLC.mjs} +1 -1
- package/dist/chunk-V5UFW2E4.js +1 -0
- package/dist/chunk-XKON5UBC.js +1 -0
- package/dist/{chunk-LGUIG2RX.mjs → chunk-Z2XAS3AB.mjs} +1 -1
- package/dist/collections/index.d.mts +2 -1
- package/dist/collections/index.d.ts +2 -1
- package/dist/either/Either.d.mts +2 -1
- package/dist/either/Either.d.ts +2 -1
- package/dist/either/Either.js +1 -1
- package/dist/either/Either.mjs +1 -1
- package/dist/either/index.d.mts +2 -1
- package/dist/either/index.d.ts +2 -1
- package/dist/either/index.js +1 -1
- package/dist/either/index.mjs +1 -1
- package/dist/error/ParseError.js +1 -1
- package/dist/error/ParseError.mjs +1 -1
- package/dist/functor/index.d.mts +13 -13
- package/dist/functor/index.d.ts +13 -13
- package/dist/index-BIu07QR3.d.ts +232 -0
- package/dist/index-DC8arpKk.d.mts +232 -0
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/iterable/Seq.d.mts +2 -1
- package/dist/iterable/Seq.d.ts +2 -1
- package/dist/iterable/Seq.js +1 -1
- package/dist/iterable/Seq.mjs +1 -1
- package/dist/iterable/index.d.mts +2 -1
- package/dist/iterable/index.d.ts +2 -1
- package/dist/iterable/index.js +1 -1
- package/dist/iterable/index.mjs +1 -1
- package/dist/list/List.d.mts +2 -1
- package/dist/list/List.d.ts +2 -1
- package/dist/list/List.js +1 -1
- package/dist/list/List.mjs +1 -1
- package/dist/list/index.d.mts +2 -1
- package/dist/list/index.d.ts +2 -1
- package/dist/list/index.js +1 -1
- package/dist/list/index.mjs +1 -1
- package/dist/map/Map.d.mts +2 -1
- package/dist/map/Map.d.ts +2 -1
- package/dist/map/Map.js +1 -1
- package/dist/map/Map.mjs +1 -1
- package/dist/map/index.d.mts +2 -1
- package/dist/map/index.d.ts +2 -1
- package/dist/map/index.js +1 -1
- package/dist/map/index.mjs +1 -1
- package/dist/map/shim.d.mts +1 -1
- package/dist/map/shim.d.ts +1 -1
- package/dist/map/shim.js +1 -1
- package/dist/map/shim.mjs +1 -1
- package/dist/option/Option.d.mts +2 -1
- package/dist/option/Option.d.ts +2 -1
- package/dist/option/Option.js +1 -1
- package/dist/option/Option.mjs +1 -1
- package/dist/option/index.d.mts +2 -1
- package/dist/option/index.d.ts +2 -1
- package/dist/option/index.js +1 -1
- package/dist/option/index.mjs +1 -1
- package/dist/set/Set.d.mts +2 -1
- package/dist/set/Set.d.ts +2 -1
- package/dist/set/Set.js +1 -1
- package/dist/set/Set.mjs +1 -1
- package/dist/set/index.d.mts +2 -1
- package/dist/set/index.d.ts +2 -1
- package/dist/set/index.js +1 -1
- package/dist/set/index.mjs +1 -1
- package/dist/set/shim.d.mts +1 -1
- package/dist/set/shim.d.ts +1 -1
- package/dist/set/shim.js +1 -1
- package/dist/set/shim.mjs +1 -1
- package/dist/try/Try.d.mts +2 -1
- package/dist/try/Try.d.ts +2 -1
- package/dist/try/Try.js +1 -1
- package/dist/try/Try.mjs +1 -1
- package/dist/try/index.d.mts +2 -1
- package/dist/try/index.d.ts +2 -1
- package/dist/try/index.js +1 -1
- package/dist/try/index.mjs +1 -1
- package/dist/tuple/Tuple.d.mts +8 -7
- package/dist/tuple/Tuple.d.ts +8 -7
- package/dist/tuple/Tuple.js +1 -1
- package/dist/tuple/Tuple.mjs +1 -1
- package/dist/tuple/index.d.mts +8 -2
- package/dist/tuple/index.d.ts +8 -2
- package/dist/tuple/index.js +1 -1
- package/dist/tuple/index.mjs +1 -1
- package/dist/util/index.d.mts +2 -1
- package/dist/util/index.d.ts +2 -1
- package/dist/util/index.js +1 -1
- package/dist/util/index.mjs +1 -1
- package/dist/util/isIterable.js +1 -1
- package/dist/util/isIterable.mjs +1 -1
- package/lib/collections/index.d.ts +8 -0
- package/lib/either/Either.d.ts +32 -0
- package/lib/either/index.d.ts +4 -0
- package/lib/error/ParseError.d.ts +2 -0
- package/lib/functor/index.d.ts +15 -0
- package/lib/index.d.ts +19 -0
- package/lib/iterable/Seq.d.ts +25 -0
- package/lib/iterable/index.d.ts +22 -0
- package/lib/list/List.d.ts +23 -0
- package/lib/list/index.d.ts +3 -0
- package/lib/map/Map.d.ts +37 -0
- package/lib/map/index.d.ts +1 -0
- package/lib/map/shim.d.ts +2 -0
- package/lib/option/Option.d.ts +44 -0
- package/lib/option/index.d.ts +5 -0
- package/lib/set/Set.d.ts +18 -0
- package/lib/set/index.d.ts +1 -0
- package/lib/set/shim.d.ts +2 -0
- package/lib/try/Try.d.ts +19 -0
- package/lib/try/index.d.ts +1 -0
- package/lib/tuple/Tuple.d.ts +16 -0
- package/lib/tuple/index.d.ts +1 -0
- package/lib/util/index.d.ts +3 -0
- package/lib/util/isIterable.d.ts +1 -0
- package/package.json +18 -18
- package/dist/chunk-3RJPXVXE.js +0 -1
- package/dist/chunk-5DQWEDA3.js +0 -1
- package/dist/chunk-6RUUD24R.mjs +0 -1
- package/dist/chunk-BFK2RZ2Z.js +0 -1
- package/dist/chunk-BYPZZZTG.js +0 -1
- package/dist/chunk-DFWZ7ANA.mjs +0 -1
- package/dist/chunk-DP5G2LT6.mjs +0 -1
- package/dist/chunk-FQY6BMNG.js +0 -1
- package/dist/chunk-LBQXRIXP.mjs +0 -0
- package/dist/chunk-RMQF6I4T.mjs +0 -1
- package/dist/chunk-SDHW57XQ.js +0 -1
- package/dist/chunk-TAJ6OYCN.mjs +0 -1
- package/dist/chunk-TVZBBVEV.js +0 -1
- package/dist/index-3866f956.d.ts +0 -227
- package/dist/index-5f972212.d.ts +0 -227
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a=class u{constructor(e){this.values=e}map(e){let r=e(this.values);return new u(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let t=this.values[e];if(r){if(r(this.values))return t;throw new Error("Cannot cast tuple value")}else return t}toArray(){return this.values}};export{a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var _chunkO2XFH626js = require('./chunk-O2XFH626.js');var s=t=>t?_(t):l(),_= exports.d =t=>new o(t),l= exports.e =()=>new i;var n=class t{constructor(e){_chunkO2XFH626js.a.call(void 0, this,"values");_chunkBNNK42JCjs.a.call(void 0, e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let a=e(u);a instanceof t&&r.push(...a.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):l()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,a)=>r(a,u),e)}};var o=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}},i= exports.b =class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};exports.a = o; exports.b = i; exports.c = s; exports.d = _; exports.e = l; exports.f = n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHH4VYR73js = require('./chunk-HH4VYR73.js');var o=t=>new (0, _chunkHH4VYR73js.b)(t),i= exports.b =t=>new (0, _chunkHH4VYR73js.a)(t);exports.a = o; exports.b = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkV5UFW2E4js = require('./chunk-V5UFW2E4.js');var _chunk5VTXJIR3js = require('./chunk-5VTXJIR3.js');var _chunkXKON5UBCjs = require('./chunk-XKON5UBC.js');var _chunk3APFKSCCjs = require('./chunk-3APFKSCC.js');var _chunkO2XFH626js = require('./chunk-O2XFH626.js');var i=class r{constructor(e){_chunkO2XFH626js.a.call(void 0, this,"values");this.values=new (0, _chunk5VTXJIR3js.a)(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new (0, _chunkV5UFW2E4js.a)([e,t]))}add(e){return new r(this.values.set(e.toArray()[0],e.toArray()[1]).entries())}remove(e){let t=new r([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){return new r(Array.from(this.values.entries()).map(t=>[t[0],e(t[1])]))}flatMap(e){let t=[];for(let[a,V]of this.values.entries()){let l=e(V);if(l instanceof r)for(let[f,m]of l.values.entries())t.push([f,m])}return new r(t)}reduce(e){return new (0, _chunk3APFKSCCjs.f)(this.entries).reduce(e)}reduceRight(e){return new (0, _chunk3APFKSCCjs.f)(this.entries).reduceRight(e)}foldLeft(e){let t=new (0, _chunk3APFKSCCjs.f)(this.entries);return a=>t.foldLeft(e)(a)}foldRight(e){let t=new (0, _chunk3APFKSCCjs.f)(this.entries);return a=>t.foldRight(e)(a)}get(e){return _chunk3APFKSCCjs.c.call(void 0, this.values.get(e))}getOrElse(e,t){return _chunk3APFKSCCjs.c.call(void 0, this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let a=_chunk3APFKSCCjs.c.call(void 0, this.values.get(e));return t}toList(){return new (0, _chunkXKON5UBCjs.b)(this.entries)}toSet(){return new (0, _chunkXKON5UBCjs.a)(this.entries)}toString(){return`Map(${this.entries.toString()})`}},U=new i([["a",1],["b",2],["c",3]]);exports.a = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-HA5XD5KC.mjs";import{c as A,f as s}from"./chunk-TYHKMGLC.mjs";import{a as m}from"./chunk-RRAIFS3D.mjs";var o=class e extends s{constructor(t){super(t)}map(t){return new e(super.map(t))}flatMap(t){return new e(super.flatMap(t))}remove(t){let i=new e().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new e(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let r=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new e(r)}get(t){return A(this.toArray()[t])}concat(t){return new e([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new n(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var w=e=>new o(e);var n=class e extends s{constructor(t){m(t)?super(new a(t)):super(t?.toArray())}add(t){return new e([...this.values,t])}remove(t){let r=new a;return r.delete(t)?new e(r):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new e(super.map(t))}flatMap(t){return new e(super.flatMap(t))}toList(){return new o(this)}toSet(){return this}toString(){return`Set(${this.toArray().toString()})`}};export{n as a,o as b,w as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXKON5UBCjs = require('./chunk-XKON5UBC.js');var _chunk3APFKSCCjs = require('./chunk-3APFKSCC.js');var u=class e{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new e(t(this.value))}flatMap(t){return t(this.value)}toOption(){return _chunk3APFKSCCjs.d.call(void 0, this.value)}toList(){return new (0, _chunkXKON5UBCjs.b)([this.value])}},n= exports.b =class e{constructor(t){this.value=t}isLeft(){return!0}isRight(){return!1}map(t){return new e(this.value)}flatMap(t){return new e(this.value)}toOption(){return _chunk3APFKSCCjs.e.call(void 0, )}toList(){return new _chunkXKON5UBCjs.b}};exports.a = u; exports.b = n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-2XH6TPQK.mjs";var t=r=>new e(r),o=r=>new e(r);export{t as a,o as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHH4VYR73js = require('./chunk-HH4VYR73.js');var i=class t{constructor(r,e){this.value=r;this.error=e}static of(r){try{return new t(r(),null)}catch(e){return new t(null,e instanceof Error?e:new Error(String(e)))}}isSuccess(){return this.error===null}isFailure(){return this.error!==null}getOrElse(r){return this.isSuccess()?this.value:r}orElse(r){return this.isSuccess()?this:r}toEither(){return this.isSuccess()?new (0, _chunkHH4VYR73js.a)(this.value):new (0, _chunkHH4VYR73js.b)(this.error)}};exports.a = i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as r}from"./chunk-Z2XAS3AB.mjs";var o=t=>new r(t),i=t=>new e(t);export{o as a,i as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=Object.defineProperty;var e=(b,a,c)=>a in b?d(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c;var f=(b,a,c)=>
|
|
1
|
+
var d=Object.defineProperty;var e=(b,a,c)=>a in b?d(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c;var f=(b,a,c)=>e(b,typeof a!="symbol"?a+"":a,c);export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var d=Object.defineProperty;var e=(b,a,c)=>a in b?d(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c;var f=(b,a,c)=>
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var d=Object.defineProperty;var e=(b,a,c)=>a in b?d(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c;var f=(b,a,c)=>e(b,typeof a!="symbol"?a+"":a,c);exports.a = f;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as K}from"./chunk-2XH6TPQK.mjs";import{a as _}from"./chunk-377WQNCB.mjs";import{a as u,b as o}from"./chunk-E35CYHY2.mjs";import{c as s,f as n}from"./chunk-TYHKMGLC.mjs";import{a as p}from"./chunk-JR557W27.mjs";var i=class r{constructor(e){p(this,"values");this.values=new _(e)}get entries(){return Array.from(this.values.entries()).map(([e,t])=>new K([e,t]))}add(e){return new r(this.values.set(e.toArray()[0],e.toArray()[1]).entries())}remove(e){let t=new r([...this.values.entries()]);return t.values.delete(e[0])?t:this}contains(e){return this.values.get(e[0])===e[1]}get size(){return this.values.size}map(e){return new r(Array.from(this.values.entries()).map(t=>[t[0],e(t[1])]))}flatMap(e){let t=[];for(let[a,V]of this.values.entries()){let l=e(V);if(l instanceof r)for(let[f,m]of l.values.entries())t.push([f,m])}return new r(t)}reduce(e){return new n(this.entries).reduce(e)}reduceRight(e){return new n(this.entries).reduceRight(e)}foldLeft(e){let t=new n(this.entries);return a=>t.foldLeft(e)(a)}foldRight(e){let t=new n(this.entries);return a=>t.foldRight(e)(a)}get(e){return s(this.values.get(e))}getOrElse(e,t){return s(this.values.get(e)).getOrElse(t)}get isEmpty(){return this.values.size===0}orElse(e,t){let a=s(this.values.get(e));return t}toList(){return new o(this.entries)}toSet(){return new u(this.entries)}toString(){return`Map(${this.entries.toString()})`}},U=new i([["a",1],["b",2],["c",3]]);export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s,b as o}from"./chunk-Z2XAS3AB.mjs";var i=class t{constructor(r,e){this.value=r;this.error=e}static of(r){try{return new t(r(),null)}catch(e){return new t(null,e instanceof Error?e:new Error(String(e)))}}isSuccess(){return this.error===null}isFailure(){return this.error!==null}getOrElse(r){return this.isSuccess()?this.value:r}orElse(r){return this.isSuccess()?this:r}toEither(){return this.isSuccess()?new s(this.value):new o(this.error)}};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkV5UFW2E4js = require('./chunk-V5UFW2E4.js');var t=r=>new (0, _chunkV5UFW2E4js.a)(r),o= exports.b =r=>new (0, _chunkV5UFW2E4js.a)(r);exports.a = t; exports.b = o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as A}from"./chunk-RRAIFS3D.mjs";import{a as p}from"./chunk-JR557W27.mjs";var s=t=>t?_(t):l(),_=t=>new o(t),l=()=>new i;var n=class t{constructor(e){p(this,"values");A(e)?this.values=e:e instanceof t?this.values=e.toArray():e||(this.values=[])}get length(){return this.toArray().length}map(e){return new t(this.toArray().map(e))}flatMap(e){let r=[];for(let u of this.values){let a=e(u);a instanceof t&&r.push(...a.values)}return new t(r)}forEach(e){this.toArray().forEach(e)}count(e){return 0}exists(e){return!this.find(e).isEmpty}filter(e){return new t(this.toArray().filter(e))}filterNot(e){return new t(this.toArray().filter(r=>!e(r)))}find(e){let r=this.toArray().find(e);return s(r)}get head(){return this.values[0]}get headOption(){return this.isEmpty?s(this.head):l()}get isEmpty(){return this.toArray().length===0}get size(){return 0}toArray(){return Array.from(this.values)}reduce(e){return this.toArray().reduce(e)}reduceRight(e){return this.toArray().reduceRight(e)}foldLeft(e){return r=>this.toArray().reduce(r,e)}foldRight(e){return r=>this.toArray().reduceRight((u,a)=>r(a,u),e)}};var o=class t{constructor(e){this.value=e}get isEmpty(){return!1}get(){return this.value}getOrElse(e){return this.value}orElse(e){return this}map(e){return new t(e(this.value))}flatMap(e){return e(this.value)}reduce(e){return e(void 0,this.value)}reduceRight(e){return e(void 0,this.value)}foldLeft(e){return r=>r(e,this.value)}foldRight(e){return r=>r(this.value,e)}toList(){return new n([this.value])}contains(e){return!1}get size(){return 0}},i=class t{get isEmpty(){return!0}get(){throw new Error("Cannot call get() on a None")}getOrElse(e){return e}orElse(e){return e}map(e){return new t}flatMap(e){return new t}reduce(e){return e(void 0,void 0)}reduceRight(e){return e(void 0,void 0)}foldLeft(e){return r=>e}foldRight(e){return r=>e}toList(){return new n}contains(e){return!1}get size(){return 0}};export{o as a,i as b,s as c,_ as d,l as e,n as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var a=class u{constructor(e){this.values=e}map(e){let r=e(this.values);return new u(r)}flatMap(e){return e(this.values)}get(e){return this.values[e]}getAs(e,r){let t=this.values[e];if(r){if(r(this.values))return t;throw new Error("Cannot cast tuple value")}else return t}toArray(){return this.values}};exports.a = a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunk3APFKSCCjs = require('./chunk-3APFKSCC.js');var _chunkBNNK42JCjs = require('./chunk-BNNK42JC.js');var o=class e extends _chunk3APFKSCCjs.f{constructor(t){super(t)}map(t){return new e(super.map(t))}flatMap(t){return new e(super.flatMap(t))}remove(t){let i=new e().toArray().indexOf(t);return this.removeAt(i)}contains(t){return this.toArray().indexOf(t)!==-1}add(t){let i=[...this.toArray(),t];return new e(i)}removeAt(t){if(t<0||t>=this.toArray().length)return this;let r=[...this.toArray().slice(0,t),...this.toArray().slice(t+1)];return new e(r)}get(t){return _chunk3APFKSCCjs.c.call(void 0, this.toArray()[t])}concat(t){return new e([...this.toArray(),...t.toArray()])}toList(){return this}toSet(){return new n(this.toArray())}toString(){return`List(${this.toArray().toString()})`}};var w=e=>new o(e);var n=class e extends _chunk3APFKSCCjs.f{constructor(t){_chunkBNNK42JCjs.a.call(void 0, t)?super(new (0, _chunk3VJERXBPjs.a)(t)):super(_optionalChain([t, 'optionalAccess', _ => _.toArray, 'call', _2 => _2()]))}add(t){return new e([...this.values,t])}remove(t){let r=new _chunk3VJERXBPjs.a;return r.delete(t)?new e(r):this}contains(t){return this.has(t)}has(t){return this.values.has(t)}map(t){return new e(super.map(t))}flatMap(t){return new e(super.flatMap(t))}toList(){return new o(this)}toSet(){return this}toString(){return`Set(${this.toArray().toString()})`}};exports.a = n; exports.b = o; exports.c = w;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i}from"./chunk-
|
|
1
|
+
import{b as i}from"./chunk-E35CYHY2.mjs";import{d as r,e as s}from"./chunk-TYHKMGLC.mjs";var u=class e{constructor(t){this.value=t}isLeft(){return!1}isRight(){return!0}map(t){return new e(t(this.value))}flatMap(t){return t(this.value)}toOption(){return r(this.value)}toList(){return new i([this.value])}},n=class e{constructor(t){this.value=t}isLeft(){return!0}isRight(){return!1}map(t){return new e(this.value)}flatMap(t){return new e(this.value)}toOption(){return s()}toList(){return new i}};export{u as a,n as b};
|
package/dist/either/Either.d.mts
CHANGED
package/dist/either/Either.d.ts
CHANGED
package/dist/either/Either.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHH4VYR73js = require('../chunk-HH4VYR73.js');require('../chunk-XKON5UBC.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-3APFKSCC.js');require('../chunk-BNNK42JC.js');require('../chunk-O2XFH626.js');exports.Left = _chunkHH4VYR73js.b; exports.Right = _chunkHH4VYR73js.a;
|
package/dist/either/Either.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-Z2XAS3AB.mjs";import"../chunk-E35CYHY2.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-TYHKMGLC.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JR557W27.mjs";export{b as Left,a as Right};
|
package/dist/either/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { E as Either, h as Left, R as Right,
|
|
1
|
+
export { E as Either, h as Left, R as Right, j as left, r as right } from '../index-DC8arpKk.mjs';
|
|
2
2
|
import '../functor/index.mjs';
|
|
3
3
|
import '../tuple/Tuple.mjs';
|
|
4
|
+
import '../tuple/index.mjs';
|
package/dist/either/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { E as Either, h as Left, R as Right,
|
|
1
|
+
export { E as Either, h as Left, R as Right, j as left, r as right } from '../index-BIu07QR3.js';
|
|
2
2
|
import '../functor/index.js';
|
|
3
3
|
import '../tuple/Tuple.js';
|
|
4
|
+
import '../tuple/index.js';
|
package/dist/either/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk63PL65AFjs = require('../chunk-63PL65AF.js');var _chunkHH4VYR73js = require('../chunk-HH4VYR73.js');require('../chunk-XKON5UBC.js');require('../chunk-3VJERXBP.js');require('../chunk-XVHCBGUW.js');require('../chunk-3APFKSCC.js');require('../chunk-BNNK42JC.js');require('../chunk-O2XFH626.js');exports.Left = _chunkHH4VYR73js.b; exports.Right = _chunkHH4VYR73js.a; exports.left = _chunk63PL65AFjs.a; exports.right = _chunk63PL65AFjs.b;
|
package/dist/either/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,b as d}from"../chunk-
|
|
1
|
+
import{a as c,b as d}from"../chunk-J4OZ7K3I.mjs";import{a,b}from"../chunk-Z2XAS3AB.mjs";import"../chunk-E35CYHY2.mjs";import"../chunk-HA5XD5KC.mjs";import"../chunk-74TKYQJS.mjs";import"../chunk-TYHKMGLC.mjs";import"../chunk-RRAIFS3D.mjs";import"../chunk-JR557W27.mjs";export{b as Left,a as Right,c as left,d as right};
|
package/dist/error/ParseError.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZTL76QDLjs = require('../chunk-ZTL76QDL.js');require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZTL76QDLjs = require('../chunk-ZTL76QDL.js');require('../chunk-O2XFH626.js');exports.ParseError = _chunkZTL76QDLjs.a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-CFYIJKWF.mjs";import"../chunk-
|
|
1
|
+
import{a}from"../chunk-CFYIJKWF.mjs";import"../chunk-JR557W27.mjs";export{a as ParseError};
|
package/dist/functor/index.d.mts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
type SingleType = any;
|
|
2
2
|
type ArrayType = SingleType[];
|
|
3
3
|
type Type = SingleType | ArrayType;
|
|
4
|
-
|
|
5
|
-
map(f: (value: A) => Type):
|
|
6
|
-
flatMap(f: (value: A) =>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
map<B extends Type>(f: (value: A) => B):
|
|
10
|
-
flatMap<B extends Type>(f: (value: A) =>
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
map<U extends ArrayType>(f: (value: A) => U):
|
|
14
|
-
flatMap<U extends ArrayType>(f: (value: A) =>
|
|
15
|
-
}
|
|
4
|
+
type _AbstractFunctor_<A extends Type> = {
|
|
5
|
+
map(f: (value: A) => Type): _AbstractFunctor_<Type>;
|
|
6
|
+
flatMap(f: (value: A) => _AbstractFunctor_<Type>): _AbstractFunctor_<Type>;
|
|
7
|
+
};
|
|
8
|
+
type _Functor_<A extends Type> = _AbstractFunctor_<A> & {
|
|
9
|
+
map<B extends Type>(f: (value: A) => B): _Functor_<B>;
|
|
10
|
+
flatMap<B extends Type>(f: (value: A) => _Functor_<B>): _Functor_<B>;
|
|
11
|
+
};
|
|
12
|
+
type _ArrayFunctor_<A extends ArrayType> = _AbstractFunctor_<A> & {
|
|
13
|
+
map<U extends ArrayType>(f: (value: A) => U): _ArrayFunctor_<U>;
|
|
14
|
+
flatMap<U extends ArrayType>(f: (value: A) => _ArrayFunctor_<U>): _ArrayFunctor_<U>;
|
|
15
|
+
};
|
|
16
16
|
|
|
17
|
-
export { ArrayType,
|
|
17
|
+
export type { ArrayType, SingleType, Type, _AbstractFunctor_, _ArrayFunctor_, _Functor_ };
|
package/dist/functor/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
type SingleType = any;
|
|
2
2
|
type ArrayType = SingleType[];
|
|
3
3
|
type Type = SingleType | ArrayType;
|
|
4
|
-
|
|
5
|
-
map(f: (value: A) => Type):
|
|
6
|
-
flatMap(f: (value: A) =>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
map<B extends Type>(f: (value: A) => B):
|
|
10
|
-
flatMap<B extends Type>(f: (value: A) =>
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
map<U extends ArrayType>(f: (value: A) => U):
|
|
14
|
-
flatMap<U extends ArrayType>(f: (value: A) =>
|
|
15
|
-
}
|
|
4
|
+
type _AbstractFunctor_<A extends Type> = {
|
|
5
|
+
map(f: (value: A) => Type): _AbstractFunctor_<Type>;
|
|
6
|
+
flatMap(f: (value: A) => _AbstractFunctor_<Type>): _AbstractFunctor_<Type>;
|
|
7
|
+
};
|
|
8
|
+
type _Functor_<A extends Type> = _AbstractFunctor_<A> & {
|
|
9
|
+
map<B extends Type>(f: (value: A) => B): _Functor_<B>;
|
|
10
|
+
flatMap<B extends Type>(f: (value: A) => _Functor_<B>): _Functor_<B>;
|
|
11
|
+
};
|
|
12
|
+
type _ArrayFunctor_<A extends ArrayType> = _AbstractFunctor_<A> & {
|
|
13
|
+
map<U extends ArrayType>(f: (value: A) => U): _ArrayFunctor_<U>;
|
|
14
|
+
flatMap<U extends ArrayType>(f: (value: A) => _ArrayFunctor_<U>): _ArrayFunctor_<U>;
|
|
15
|
+
};
|
|
16
16
|
|
|
17
|
-
export { ArrayType,
|
|
17
|
+
export type { ArrayType, SingleType, Type, _AbstractFunctor_, _ArrayFunctor_, _Functor_ };
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { Type, _Functor_ } from './functor/index.js';
|
|
2
|
+
import { _Tuple_, Tuple } from './tuple/Tuple.js';
|
|
3
|
+
import './tuple/index.js';
|
|
4
|
+
|
|
5
|
+
type _Option_<T extends Type> = {
|
|
6
|
+
get(): T;
|
|
7
|
+
getOrElse(defaultValue: T): T;
|
|
8
|
+
orElse(alternative: _Option_<T>): _Option_<T>;
|
|
9
|
+
map<U extends Type>(f: (value: T) => U): _Option_<U>;
|
|
10
|
+
flatMap<U extends Type>(f: (value: T) => _Option_<U>): _Option_<U>;
|
|
11
|
+
toList(): _Iterable_<T>;
|
|
12
|
+
valueOf(): Object;
|
|
13
|
+
} & _Traversable_<T> & _Functor_<T>;
|
|
14
|
+
declare class Some<A extends Type> implements _Option_<A> {
|
|
15
|
+
private value;
|
|
16
|
+
constructor(value: A);
|
|
17
|
+
get isEmpty(): boolean;
|
|
18
|
+
get(): A;
|
|
19
|
+
getOrElse(defaultValue: A): A;
|
|
20
|
+
orElse(alternative: _Option_<A>): _Option_<A>;
|
|
21
|
+
map<U extends Type>(f: (value: A) => U): _Option_<U>;
|
|
22
|
+
flatMap<U extends Type>(f: (value: A) => _Option_<U>): _Option_<U>;
|
|
23
|
+
reduce<U>(f: (acc: U, value: A) => U): U;
|
|
24
|
+
reduceRight<U>(f: (acc: U, value: A) => U): U;
|
|
25
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
26
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
27
|
+
toList(): _Iterable_<A>;
|
|
28
|
+
contains(value: A): boolean;
|
|
29
|
+
get size(): number;
|
|
30
|
+
}
|
|
31
|
+
declare class None<A extends Type> implements _Option_<A> {
|
|
32
|
+
get isEmpty(): boolean;
|
|
33
|
+
get(): A;
|
|
34
|
+
getOrElse(defaultValue: A): A;
|
|
35
|
+
orElse(alternative: _Option_<A>): _Option_<A>;
|
|
36
|
+
map<U extends Type>(f: (value: A) => U): _Option_<U>;
|
|
37
|
+
flatMap<U extends Type>(f: (value: A) => _Option_<U>): _Option_<U>;
|
|
38
|
+
reduce(f: (acc: A, value: A) => A): A;
|
|
39
|
+
reduceRight(f: (b: A, a: A) => A): A;
|
|
40
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
41
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
42
|
+
toList(): _Iterable_<A>;
|
|
43
|
+
contains(value: A): boolean;
|
|
44
|
+
get size(): number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare const option: <T extends unknown>(value?: T) => _Option_<T>;
|
|
48
|
+
declare const some: <T extends unknown>(value: T) => _Option_<T>;
|
|
49
|
+
declare const none: <T extends unknown>() => _Option_<T>;
|
|
50
|
+
|
|
51
|
+
declare class Seq<A> implements _Iterable_<A> {
|
|
52
|
+
protected readonly values: Iterable<A>;
|
|
53
|
+
constructor(values?: Iterable<A> | _Iterable_<A>);
|
|
54
|
+
readonly [n: number]: A;
|
|
55
|
+
get length(): number;
|
|
56
|
+
map<B>(f: (a: A) => B): _Iterable_<B>;
|
|
57
|
+
flatMap<B>(f: (a: A) => _Iterable_<B>): _Iterable_<B>;
|
|
58
|
+
forEach(f: (a: A) => void): void;
|
|
59
|
+
count(p: (x: A) => boolean): number;
|
|
60
|
+
exists(p: (a: A) => boolean): Boolean;
|
|
61
|
+
filter(p: (a: A) => boolean): _Iterable_<A>;
|
|
62
|
+
filterNot(p: (a: A) => boolean): _Iterable_<A>;
|
|
63
|
+
find(p: (a: A) => boolean): _Option_<A>;
|
|
64
|
+
get head(): A;
|
|
65
|
+
get headOption(): _Option_<A>;
|
|
66
|
+
get isEmpty(): boolean;
|
|
67
|
+
get size(): number;
|
|
68
|
+
toArray(): A[];
|
|
69
|
+
reduce(f: (prev: A, curr: A) => A): A;
|
|
70
|
+
reduceRight(f: (prev: A, curr: A) => A): A;
|
|
71
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
72
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type _Iterable_<A extends Type> = {
|
|
76
|
+
count(p: (x: A) => boolean): number;
|
|
77
|
+
find(p: (a: A) => boolean): _Option_<A>;
|
|
78
|
+
forEach(f: (a: A) => void): void;
|
|
79
|
+
exists(p: (a: A) => boolean): Boolean;
|
|
80
|
+
filter(p: (a: A) => boolean): _Iterable_<A>;
|
|
81
|
+
filterNot(p: (a: A) => boolean): _Iterable_<A>;
|
|
82
|
+
reduce(f: (b: A, a: A) => A): A;
|
|
83
|
+
reduceRight(f: (b: A, a: A) => A): A;
|
|
84
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
85
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
86
|
+
get head(): A;
|
|
87
|
+
get headOption(): _Option_<A>;
|
|
88
|
+
get isEmpty(): boolean;
|
|
89
|
+
map<B extends Type>(f: (a: A) => B): _Iterable_<B>;
|
|
90
|
+
flatMap<B extends Type>(f: (a: A) => _Iterable_<B>): _Iterable_<B>;
|
|
91
|
+
get size(): number;
|
|
92
|
+
toArray(): readonly A[];
|
|
93
|
+
} & _Functor_<A>;
|
|
94
|
+
|
|
95
|
+
type _Set_<T> = {
|
|
96
|
+
has(value: T): boolean;
|
|
97
|
+
} & _Iterable_<T> & _Collection<T>;
|
|
98
|
+
declare class Set<A> extends Seq<A> implements _Set_<A> {
|
|
99
|
+
constructor(iterable?: Iterable<A> | _Iterable_<A>);
|
|
100
|
+
add(value: A): Set<A>;
|
|
101
|
+
remove(value: A): Set<A>;
|
|
102
|
+
contains(value: A): boolean;
|
|
103
|
+
has(value: A): boolean;
|
|
104
|
+
map<B>(f: (a: A) => B): Set<B>;
|
|
105
|
+
flatMap<B>(f: (a: A) => _Iterable_<B>): Set<B>;
|
|
106
|
+
toList(): _List_<A>;
|
|
107
|
+
toSet(): _Set_<A>;
|
|
108
|
+
toString(): string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
type IConverters<A> = {
|
|
112
|
+
toList(): _List_<A>;
|
|
113
|
+
toSet(): _Set_<A>;
|
|
114
|
+
toString(): string;
|
|
115
|
+
};
|
|
116
|
+
type _Collection<A> = IConverters<A>;
|
|
117
|
+
|
|
118
|
+
interface _List_<T> extends _Iterable_<T>, ArrayLike<T> {
|
|
119
|
+
add(item: T): _List_<T>;
|
|
120
|
+
}
|
|
121
|
+
declare class List<A> extends Seq<A> implements _List_<A>, _Collection<A> {
|
|
122
|
+
constructor(values?: Iterable<A> | _Iterable_<A>);
|
|
123
|
+
readonly [n: number]: A;
|
|
124
|
+
map<B>(f: (a: A) => B): List<B>;
|
|
125
|
+
flatMap<B>(f: (a: A) => _Iterable_<B>): List<B>;
|
|
126
|
+
remove(value: A): List<A>;
|
|
127
|
+
contains(value: A): boolean;
|
|
128
|
+
add(item: A): List<A>;
|
|
129
|
+
removeAt(index: number): List<A>;
|
|
130
|
+
get(index: number): _Option_<A>;
|
|
131
|
+
concat(other: List<A>): List<A>;
|
|
132
|
+
toList(): _List_<A>;
|
|
133
|
+
toSet(): Set<A>;
|
|
134
|
+
toString(): string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
declare const list: <T extends unknown>(items: T[] | undefined) => List<T>;
|
|
138
|
+
|
|
139
|
+
type SafeTraversable<K, V> = Omit<_Traversable_<_Tuple_<[K, V]>>, "map" | "flatMap">;
|
|
140
|
+
type _Map_<K, V> = {
|
|
141
|
+
map<U>(f: (value: any) => U): _Map_<K, U>;
|
|
142
|
+
flatMap<U>(f: (value: any) => _Map_<K, U>): _Map_<K, U>;
|
|
143
|
+
get(key: K): _Option_<V>;
|
|
144
|
+
getOrElse(key: K, defaultValue: V): V;
|
|
145
|
+
orElse(key: K, alternative: _Option_<V>): _Option_<V>;
|
|
146
|
+
} & SafeTraversable<K, V> & _Collection<_Tuple_<[K, V]>>;
|
|
147
|
+
declare class iMap<K, V> implements _Map_<K, V> {
|
|
148
|
+
private values;
|
|
149
|
+
private get entries();
|
|
150
|
+
constructor(entries?: readonly (readonly [K, V])[] | IterableIterator<[K, V]> | null);
|
|
151
|
+
add(item: _Tuple_<[K, V]>): iMap<K, V>;
|
|
152
|
+
remove(value: _Tuple_<[K, V]>): iMap<K, V>;
|
|
153
|
+
contains(value: _Tuple_<[K, V]>): boolean;
|
|
154
|
+
get size(): number;
|
|
155
|
+
map<U>(f: (value: V) => U): _Map_<K, U>;
|
|
156
|
+
flatMap<U>(f: (value: V) => _Map_<K, U>): _Map_<K, U>;
|
|
157
|
+
reduce(f: (acc: Tuple<[K, V]>, value: Tuple<[K, V]>) => Tuple<[K, V]>): Tuple<[K, V]>;
|
|
158
|
+
reduceRight(f: (acc: Tuple<[K, V]>, value: Tuple<[K, V]>) => Tuple<[K, V]>): Tuple<[K, V]>;
|
|
159
|
+
foldLeft<B>(z: B): (op: (b: B, a: _Tuple_<[K, V]>) => B) => B;
|
|
160
|
+
foldRight<B>(z: B): (op: (a: _Tuple_<[K, V]>, b: B) => B) => B;
|
|
161
|
+
get(key: K): _Option_<V>;
|
|
162
|
+
getOrElse(key: K, defaultValue: V): V;
|
|
163
|
+
get isEmpty(): boolean;
|
|
164
|
+
orElse(key: K, alternative: _Option_<V>): _Option_<V>;
|
|
165
|
+
toList(): _List_<Tuple<[K, V]>>;
|
|
166
|
+
toSet(): _Set_<Tuple<[K, V]>>;
|
|
167
|
+
toString(): string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
type Either<L, R> = {
|
|
171
|
+
value: L | R;
|
|
172
|
+
isLeft(): boolean;
|
|
173
|
+
isRight(): boolean;
|
|
174
|
+
map<U>(f: (value: R) => U): Either<L, U>;
|
|
175
|
+
flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
|
|
176
|
+
toOption(): _Option_<R>;
|
|
177
|
+
toList(): List<R>;
|
|
178
|
+
} & _Functor_<R>;
|
|
179
|
+
declare class Right<L, R> implements Either<L, R> {
|
|
180
|
+
value: R;
|
|
181
|
+
constructor(value: R);
|
|
182
|
+
isLeft(): this is Left<L, R>;
|
|
183
|
+
isRight(): this is Right<L, R>;
|
|
184
|
+
map<U>(f: (value: R) => U): Either<L, U>;
|
|
185
|
+
flatMap<U>(f: (value: R) => Either<L, U>): Either<L, U>;
|
|
186
|
+
toOption(): _Option_<R>;
|
|
187
|
+
toList(): List<R>;
|
|
188
|
+
}
|
|
189
|
+
declare class Left<L, R> implements Either<L, R> {
|
|
190
|
+
value: L;
|
|
191
|
+
constructor(value: L);
|
|
192
|
+
isLeft(): this is Left<L, R>;
|
|
193
|
+
isRight(): this is Right<L, R>;
|
|
194
|
+
map<U>(_f: (value: R) => U): Either<L, U>;
|
|
195
|
+
flatMap<U>(_f: (value: R) => Either<L, U>): Either<L, U>;
|
|
196
|
+
toOption(): _Option_<R>;
|
|
197
|
+
toList(): List<R>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
declare const left: <L, R>(value: L) => Either<L, R>;
|
|
201
|
+
declare const right: <L, R>(value: R) => Either<L, R>;
|
|
202
|
+
|
|
203
|
+
type _Try_<T> = {
|
|
204
|
+
isSuccess(): boolean;
|
|
205
|
+
isFailure(): boolean;
|
|
206
|
+
getOrElse(defaultValue: T): T;
|
|
207
|
+
orElse(alternative: _Try_<T>): _Try_<T>;
|
|
208
|
+
toEither(): Either<Error, T>;
|
|
209
|
+
};
|
|
210
|
+
declare class Try<T> implements _Try_<T> {
|
|
211
|
+
private readonly value;
|
|
212
|
+
private readonly error;
|
|
213
|
+
private constructor();
|
|
214
|
+
static of<T>(f: () => T): _Try_<T>;
|
|
215
|
+
isSuccess(): boolean;
|
|
216
|
+
isFailure(): boolean;
|
|
217
|
+
getOrElse(defaultValue: T): T;
|
|
218
|
+
orElse(alternative: _Try_<T>): _Try_<T>;
|
|
219
|
+
toEither(): Either<Error, T>;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
type _Traversable_<A extends Type> = _Functor_<A> & {
|
|
223
|
+
get size(): number;
|
|
224
|
+
get isEmpty(): boolean;
|
|
225
|
+
contains(value: A): boolean;
|
|
226
|
+
reduce(f: (b: A, a: A) => A): A;
|
|
227
|
+
reduceRight(f: (b: A, a: A) => A): A;
|
|
228
|
+
foldLeft<B>(z: B): (op: (b: B, a: A) => B) => B;
|
|
229
|
+
foldRight<B>(z: B): (op: (a: A, b: B) => B) => B;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export { type Either as E, type IConverters as I, List as L, None as N, Right as R, Some as S, Try as T, type _Option_ as _, Seq as a, type _Iterable_ as b, type _Set_ as c, Set as d, type _Collection as e, type _List_ as f, type _Map_ as g, Left as h, iMap as i, left as j, type _Try_ as k, list as l, type _Traversable_ as m, none as n, option as o, right as r, some as s };
|