functype 0.0.2 → 0.0.3
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-E4GBAXJ4.js +1 -0
- package/dist/chunk-HWJMIJH6.cjs +1 -0
- package/dist/chunk-PXY4XULG.cjs +1 -0
- package/dist/chunk-QK5JVYJ3.js +1 -0
- package/dist/either/Left.d.cts +1 -2
- package/dist/either/Left.d.ts +1 -2
- package/dist/either/Right.d.cts +1 -2
- package/dist/either/Right.d.ts +1 -2
- package/dist/either/index.cjs +1 -1
- package/dist/either/index.d.cts +1 -2
- package/dist/either/index.d.ts +1 -2
- package/dist/either/index.js +1 -1
- package/dist/{index-402b9aa2.d.ts → index-7c5c3a08.d.ts} +26 -2
- package/dist/{index-28de5927.d.ts → index-92d6660e.d.ts} +26 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -9
- package/dist/index.d.ts +2 -9
- package/dist/index.js +1 -0
- package/dist/list/List.cjs +1 -1
- package/dist/list/List.d.cts +2 -20
- package/dist/list/List.d.ts +2 -20
- package/dist/list/List.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-VTKL7OQI.js";var n=class r{constructor(t){i(this,"items");this.items=t?[...t]:[]}get length(){return this.items.length}add(t){return new r([...this.items,t])}removeAt(t){if(t<0||t>=this.items.length)return this;let e=[...this.items.slice(0,t),...this.items.slice(t+1)];return new r(e)}get(t){return this.items[t]}toArray(){return this.items}map(t){return new r(this.items.map(t))}flatMap(t){return this.items.reduce((e,s)=>e.concat(t(s)),new r)}reduce(t){let e=this.items.reduce(t,void 0);return new r([e])}foldLeft(t,e){return this.items.reduce(e,t)}foldRight(t,e){return this.items.reduceRight((s,u)=>e(u,s),t)}concat(t){return new r([...this.items,...t.items])}toString(){return`List(${this.items.toString()})`}};export{n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4EVP3IRIcjs = require('./chunk-4EVP3IRI.cjs');var _chunkCB3ZZ3RLcjs = require('./chunk-CB3ZZ3RL.cjs');var _chunk6VKVA3TKcjs = require('./chunk-6VKVA3TK.cjs');var s=r=>new (0, _chunk4EVP3IRIcjs.a)(r),n= exports.b =r=>new (0, _chunkCB3ZZ3RLcjs.a)(r),h= exports.c =r=>{let t=parseInt(r,10);return isNaN(t)?s(new (0, _chunk6VKVA3TKcjs.a)(`${t}`)):n(t)};exports.a = s; exports.b = n; exports.c = h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGWLTG6GZcjs = require('./chunk-GWLTG6GZ.cjs');var n=class r{constructor(t){_chunkGWLTG6GZcjs.a.call(void 0, this,"items");this.items=t?[...t]:[]}get length(){return this.items.length}add(t){return new r([...this.items,t])}removeAt(t){if(t<0||t>=this.items.length)return this;let e=[...this.items.slice(0,t),...this.items.slice(t+1)];return new r(e)}get(t){return this.items[t]}toArray(){return this.items}map(t){return new r(this.items.map(t))}flatMap(t){return this.items.reduce((e,s)=>e.concat(t(s)),new r)}reduce(t){let e=this.items.reduce(t,void 0);return new r([e])}foldLeft(t,e){return this.items.reduce(e,t)}foldRight(t,e){return this.items.reduceRight((s,u)=>e(u,s),t)}concat(t){return new r([...this.items,...t.items])}toString(){return`List(${this.items.toString()})`}};exports.a = n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-ABUN2GHU.js";import{a as o}from"./chunk-CN6MP6AJ.js";import{a as e}from"./chunk-ZTL76QDL.js";var s=r=>new i(r),n=r=>new o(r),h=r=>{let t=parseInt(r,10);return isNaN(t)?s(new e(`${t}`)):n(t)};export{s as a,n as b,h as c};
|
package/dist/either/Left.d.cts
CHANGED
package/dist/either/Left.d.ts
CHANGED
package/dist/either/Right.d.cts
CHANGED
package/dist/either/Right.d.ts
CHANGED
package/dist/either/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHWJMIJH6cjs = require('../chunk-HWJMIJH6.cjs');require('../chunk-4EVP3IRI.cjs');require('../chunk-CB3ZZ3RL.cjs');require('../chunk-6VKVA3TK.cjs');require('../chunk-GWLTG6GZ.cjs');exports.left = _chunkHWJMIJH6cjs.a; exports.parseNumber = _chunkHWJMIJH6cjs.c; exports.right = _chunkHWJMIJH6cjs.b;
|
package/dist/either/index.d.cts
CHANGED
package/dist/either/index.d.ts
CHANGED
package/dist/either/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a,b,c}from"../chunk-QK5JVYJ3.js";import"../chunk-ABUN2GHU.js";import"../chunk-CN6MP6AJ.js";import"../chunk-ZTL76QDL.js";import"../chunk-VTKL7OQI.js";export{a as left,c as parseNumber,b as right};
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { ParseError } from './error/ParseError.cjs';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
declare class List<T> implements IFunctor<T> {
|
|
4
|
+
private readonly items;
|
|
5
|
+
constructor(items?: T[]);
|
|
6
|
+
get length(): number;
|
|
7
|
+
add(item: T): List<T>;
|
|
8
|
+
removeAt(index: number): List<T>;
|
|
9
|
+
get(index: number): T | undefined;
|
|
10
|
+
toArray(): readonly T[];
|
|
11
|
+
map<U>(f: (value: T) => U): List<U>;
|
|
12
|
+
flatMap<U>(f: (value: T) => List<U>): List<U>;
|
|
13
|
+
reduce<U>(f: (acc: U, value: T) => U): List<U>;
|
|
14
|
+
foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
|
|
15
|
+
foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
|
|
16
|
+
concat(other: List<T>): List<T>;
|
|
17
|
+
toString(): string;
|
|
18
|
+
}
|
|
3
19
|
|
|
4
20
|
declare class Right<L, R> implements Either<L, R> {
|
|
5
21
|
value: R;
|
|
@@ -36,4 +52,12 @@ declare const left: <L, R>(value: L) => Either<L, R>;
|
|
|
36
52
|
declare const right: <L, R>(value: R) => Either<L, R>;
|
|
37
53
|
declare const parseNumber: (input: string) => Either<ParseError, number>;
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
interface IFunctor<T> {
|
|
56
|
+
map<U>(f: (value: T) => U): IFunctor<U>;
|
|
57
|
+
flatMap<U>(f: (value: T) => IFunctor<U>): IFunctor<U>;
|
|
58
|
+
reduce<U>(f: (acc: U, value: T) => U): IFunctor<U>;
|
|
59
|
+
foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
|
|
60
|
+
foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { Either as E, IFunctor as I, List as L, Right as R, Left as a, left as l, parseNumber as p, right as r };
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { ParseError } from './error/ParseError.js';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
declare class List<T> implements IFunctor<T> {
|
|
4
|
+
private readonly items;
|
|
5
|
+
constructor(items?: T[]);
|
|
6
|
+
get length(): number;
|
|
7
|
+
add(item: T): List<T>;
|
|
8
|
+
removeAt(index: number): List<T>;
|
|
9
|
+
get(index: number): T | undefined;
|
|
10
|
+
toArray(): readonly T[];
|
|
11
|
+
map<U>(f: (value: T) => U): List<U>;
|
|
12
|
+
flatMap<U>(f: (value: T) => List<U>): List<U>;
|
|
13
|
+
reduce<U>(f: (acc: U, value: T) => U): List<U>;
|
|
14
|
+
foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
|
|
15
|
+
foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
|
|
16
|
+
concat(other: List<T>): List<T>;
|
|
17
|
+
toString(): string;
|
|
18
|
+
}
|
|
3
19
|
|
|
4
20
|
declare class Right<L, R> implements Either<L, R> {
|
|
5
21
|
value: R;
|
|
@@ -36,4 +52,12 @@ declare const left: <L, R>(value: L) => Either<L, R>;
|
|
|
36
52
|
declare const right: <L, R>(value: R) => Either<L, R>;
|
|
37
53
|
declare const parseNumber: (input: string) => Either<ParseError, number>;
|
|
38
54
|
|
|
39
|
-
|
|
55
|
+
interface IFunctor<T> {
|
|
56
|
+
map<U>(f: (value: T) => U): IFunctor<U>;
|
|
57
|
+
flatMap<U>(f: (value: T) => IFunctor<U>): IFunctor<U>;
|
|
58
|
+
reduce<U>(f: (acc: U, value: T) => U): IFunctor<U>;
|
|
59
|
+
foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
|
|
60
|
+
foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { Either as E, IFunctor as I, List as L, Right as R, Left as a, left as l, parseNumber as p, right as r };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHWJMIJH6cjs = require('./chunk-HWJMIJH6.cjs');require('./chunk-4EVP3IRI.cjs');require('./chunk-CB3ZZ3RL.cjs');require('./chunk-6VKVA3TK.cjs');var _chunkPXY4XULGcjs = require('./chunk-PXY4XULG.cjs');require('./chunk-GWLTG6GZ.cjs');exports.List = _chunkPXY4XULGcjs.a; exports.left = _chunkHWJMIJH6cjs.a; exports.parseNumber = _chunkHWJMIJH6cjs.c; exports.right = _chunkHWJMIJH6cjs.b;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
flatMap<U>(f: (value: T) => IFunctor<U>): IFunctor<U>;
|
|
4
|
-
reduce<U>(f: (acc: U, value: T) => U): IFunctor<U>;
|
|
5
|
-
foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
|
|
6
|
-
foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { IFunctor };
|
|
1
|
+
export { E as Either, I as IFunctor, L as List, l as left, p as parseNumber, r as right } from './index-7c5c3a08.js';
|
|
2
|
+
import './error/ParseError.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
flatMap<U>(f: (value: T) => IFunctor<U>): IFunctor<U>;
|
|
4
|
-
reduce<U>(f: (acc: U, value: T) => U): IFunctor<U>;
|
|
5
|
-
foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
|
|
6
|
-
foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export { IFunctor };
|
|
1
|
+
export { E as Either, I as IFunctor, L as List, l as left, p as parseNumber, r as right } from './index-92d6660e.js';
|
|
2
|
+
import './error/ParseError.js';
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b as t,c as e}from"./chunk-QK5JVYJ3.js";import"./chunk-ABUN2GHU.js";import"./chunk-CN6MP6AJ.js";import"./chunk-ZTL76QDL.js";import{a as U}from"./chunk-E4GBAXJ4.js";import"./chunk-VTKL7OQI.js";export{U as List,a as left,e as parseNumber,t as right};
|
package/dist/list/List.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPXY4XULGcjs = require('../chunk-PXY4XULG.cjs');require('../chunk-GWLTG6GZ.cjs');exports.List = _chunkPXY4XULGcjs.a;
|
package/dist/list/List.d.cts
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare class List<T> implements IFunctor<T> {
|
|
4
|
-
private readonly items;
|
|
5
|
-
constructor(items?: T[]);
|
|
6
|
-
get length(): number;
|
|
7
|
-
add(item: T): List<T>;
|
|
8
|
-
removeAt(index: number): List<T>;
|
|
9
|
-
get(index: number): T | undefined;
|
|
10
|
-
toArray(): readonly T[];
|
|
11
|
-
map<U>(f: (value: T) => U): List<U>;
|
|
12
|
-
flatMap<U>(f: (value: T) => List<U>): List<U>;
|
|
13
|
-
reduce<U>(f: (acc: U, value: T) => U): List<U>;
|
|
14
|
-
foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
|
|
15
|
-
foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
|
|
16
|
-
concat(other: List<T>): List<T>;
|
|
17
|
-
toString(): string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { List };
|
|
1
|
+
export { L as List } from '../index-7c5c3a08.js';
|
|
2
|
+
import '../error/ParseError.cjs';
|
package/dist/list/List.d.ts
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare class List<T> implements IFunctor<T> {
|
|
4
|
-
private readonly items;
|
|
5
|
-
constructor(items?: T[]);
|
|
6
|
-
get length(): number;
|
|
7
|
-
add(item: T): List<T>;
|
|
8
|
-
removeAt(index: number): List<T>;
|
|
9
|
-
get(index: number): T | undefined;
|
|
10
|
-
toArray(): readonly T[];
|
|
11
|
-
map<U>(f: (value: T) => U): List<U>;
|
|
12
|
-
flatMap<U>(f: (value: T) => List<U>): List<U>;
|
|
13
|
-
reduce<U>(f: (acc: U, value: T) => U): List<U>;
|
|
14
|
-
foldLeft<U>(initialValue: U, f: (acc: U, value: T) => U): U;
|
|
15
|
-
foldRight<U>(initialValue: U, f: (value: T, acc: U) => U): U;
|
|
16
|
-
concat(other: List<T>): List<T>;
|
|
17
|
-
toString(): string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { List };
|
|
1
|
+
export { L as List } from '../index-92d6660e.js';
|
|
2
|
+
import '../error/ParseError.js';
|
package/dist/list/List.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a
|
|
1
|
+
import{a}from"../chunk-E4GBAXJ4.js";import"../chunk-VTKL7OQI.js";export{a as List};
|