This commit is contained in:
Rowan 2025-10-21 17:46:59 -04:00
parent 665516df55
commit 7382131674
24 changed files with 660 additions and 1 deletions

View file

@ -2,9 +2,11 @@
"name": "kojima",
"version": "2.0.0",
"main": "src/index.js",
"types": "types/index.d.ts",
"type": "module",
"scripts": {
"test": "node --test"
"test": "node --test",
"emit": "npx -p typescript tsc"
},
"repository": {
"type": "git",

11
tsconfig.json Normal file
View file

@ -0,0 +1,11 @@
{
"include": ["./src/*", "./src/**/*"],
"compilerOptions": {
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "types",
"declarationMap": true
}
}

2
types/alias.d.ts vendored Normal file
View file

@ -0,0 +1,2 @@
export function alias(type: any, aliases: any): void;
//# sourceMappingURL=alias.d.ts.map

1
types/alias.d.ts.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"alias.d.ts","sourceRoot":"","sources":["../src/alias.js"],"names":[],"mappings":"AAEO,qDAIN"}

2
types/common.d.ts vendored Normal file
View file

@ -0,0 +1,2 @@
export function id<T>(value: T): T;
//# sourceMappingURL=common.d.ts.map

1
types/common.d.ts.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.js"],"names":[],"mappings":"AAKO,mBAJM,CAAC,SACH,CAAC,GACC,CAAC,CAEkB"}

4
types/error.d.ts vendored Normal file
View file

@ -0,0 +1,4 @@
export class UnwrapError extends Error {
constructor(desc: any);
}
//# sourceMappingURL=error.d.ts.map

1
types/error.d.ts.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.js"],"names":[],"mappings":"AAAA;IAGE,uBAEC;CACF"}

3
types/index.d.ts vendored Normal file
View file

@ -0,0 +1,3 @@
export * from "./option.js";
export * from "./result.js";
//# sourceMappingURL=index.d.ts.map

1
types/index.d.ts.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}

290
types/option.d.ts vendored Normal file
View file

@ -0,0 +1,290 @@
export class Option {
/**
* @template T
* @param {T} value
* @returns {Some<T>}
*/
static some<T>(value: T): Some<T>;
/** @returns {None} */
static none(): _None;
/**
* @param {(value: T) => Option<T>} fn
* @param {Option<T>} self
* @returns {Option<T>}
*/
static chain(fn: (value: T) => Option<T>, self: Option<T>): Option<T>;
/**
* @param {(value: T) => bool} fn
* @param {Option<T>} self
* @returns {Option<T>}
*/
static filter(predicate: any, self: Option<T>): Option<T>;
/**
* @template V
* @param {(value: T) => V} fn
* @param {Option<T>} self
* @returns {Option<V>}
*/
static map<V>(fn: (value: T) => V, self: Option<T>): Option<V>;
/**
* @param {Option<T>} other
* @param {Option<T>} self
* @returns {Option<T>}
*/
static alt(other: Option<T>, self: Option<T>): Option<T>;
/**
* @param {Option<T>} other
* @param {Option<T>} self
* @returns {Option<T>}
*/
static equals(other: Option<T>, self: Option<T>): Option<T>;
/**
* @param {Option<T>} other
* @param {Option<T>} self
* @returns {Option<T>}
*/
static lte(other: Option<T>, self: Option<T>): Option<T>;
}
/** @template T */
export class Some<T> extends Option {
/** @param {T} value */
constructor(value: T);
/**
* @returns {this is Some}
*/
isSome(): this is Some<any>;
/**
* @returns {this is _None}
*/
isNone(): this is _None;
/**
* @param {(value: T) => Option<T>} fn
* @returns {Option<T>}
*/
andThen(fn: (value: T) => Option<T>): Option<T>;
/**
* @param {Option<T>} other
* @returns {Option<T>}
*/
and(other: Option<T>): Option<T>;
/**
* @param {Option<T>} other
* @returns {Option<T>}
*/
or(_other: any): Option<T>;
/**
* @param {() => Option<T>} other
* @returns {Option<T>}
*/
orElse(_fn: any): Option<T>;
/**
* @template T
* @param {(value: T) => bool} predicate
* @returns {Option<T>}
*/
filter<T_1>(predicate: (value: T_1) => bool): Option<T_1>;
/**
* @param {Option<T>} other
* @returns {bool}
*/
equals(other: Option<T>): bool;
/**
* @param {Option<T>} other
* @returns {bool}
*/
lte(other: Option<T>): bool;
/**
* @template [V=T]
* @param {(acc: V, value: T) => V} reducer
* @param {V} init
* @returns {V}
*/
reduce<V = T>(reducer: (acc: V, value: T) => V, init: V): V;
/**
* @returns {Option<T>}
*/
flatten(): Option<T>;
/**
* @template V
* @param {(value: T) => V} fn
* @returns {Option<V>}
*/
map<V>(fn: (value: T) => V): Option<V>;
/**
* @template V
* @param {V} _default
* @param {(value: T) => V} fn
* @returns {V}
*/
mapOr<V>(_default: V, fn: (value: T) => V): V;
/**
* @template V
* @param {() => V} _defaultFn
* @param {(value: T) => V} fn
* @returns {V}
*/
mapOrElse<V>(_defaultFn: () => V, fn: (value: T) => V): V;
/**
* @template E
* @param {E} _err
* @returns {Result<T, E>}
*/
okOr<E>(_err: E): Result<T, E>;
/**
* @template E
* @template {() => E} F
* @param {F} _err
* @returns {Result<T, E>}
*/
okOrElse<E, F extends () => E>(_err: F): Result<T, E>;
/**
* @param {(value: T) => void} fn
* @returns {this}
*/
inspect(fn: (value: T) => void): this;
/**
* @returns {T}
* @throws {UnwrapError}
*/
unwrap(): T;
/**
* @param {T} _value
* @returns {T}
*/
unwrapOr(_value: T): T;
/**
* @param {() => T} _fn
* @returns {T}
*/
unwrapOrElse(_fn: () => T): T;
#private;
}
export const None: _None;
declare class _None extends Option {
/**
* @returns {this is Some}
*/
isSome(): this is Some<any>;
/**
* @returns {this is _None}
*/
isNone(): this is _None;
/**
* @template T
* @param {Option<T>} _other
* @returns {Option<T>}
*/
and<T>(_other: Option<T>): Option<T>;
/**
* @template T
* @template {Option<T>} R
* @param {(value: T) => R} fn
* @returns {R}
*/
andThen<T, R extends Option<T>>(_fn: any): R;
/**
* @template T
* @param {Option<T>} other
* @returns {Option<T>}
*/
or<T>(other: Option<T>): Option<T>;
/**
* @template T
* @param {() => Option<T>} other
* @returns {Option<T>}
*/
orElse<T>(fn: any): Option<T>;
/**
* @template T
* @param {(value: T) => bool} _predicate
* @returns {Option<T>}
*/
filter<T>(_predicate: (value: T) => bool): Option<T>;
/**
* @template T
* @param {Option<T>} other
* @returns {bool}
*/
equals<T>(other: Option<T>): bool;
/**
* @template T
* @param {Option<T>} _other
* @returns {bool}
*/
lte<T>(_other: Option<T>): bool;
/**
* @template T, [V=T]
* @param {(acc: V, value: T) => V} _reducer
* @param {V} init
* @returns {V}
*/
reduce<T, V = T>(_reducer: (acc: V, value: T) => V, init: V): V;
/**
* @template T
* @template {Option<T>} R
* @returns {R}
*/
flatten<T, R extends Option<T>>(): R;
/**
* @template V
* @template {Option<T>} R
* @param {(value: T) => V} fn
* @returns {R}
*/
map<V, R extends Option<T>>(_fn: any): R;
/**
* @template V
* @param {V} defaultValue
* @param {(value: T) => V} _fn
* @returns {V}
*/
mapOr<V>(defaultValue: V, _fn: (value: T) => V): V;
/**
* @template V
* @param {() => V} defaultFn
* @param {(value: T) => V} _fn
* @returns {V}
*/
mapOrElse<V>(defaultFn: () => V, _fn: (value: T) => V): V;
/**
* @template T, E
* @template {Result<T, E>} R
* @param {E} err
* @returns {R}
*/
okOr<T, E, R extends Result<T, E>>(err: E): R;
/**
* @template T, E
* @template {Result<T, E>} R
* @template {() => E} F
* @param {F} err
* @returns {R}
*/
okOrElse<T, E, R extends Result<T, E>, F extends () => E>(err: F): R;
/**
* @template T
* @param {(value: T) => void} _fn
* @returns {this}
*/
inspect<T>(_fn: (value: T) => void): this;
/**
* @template T
* @returns {T}
* @throws {UnwrapError}
*/
unwrap<T>(): T;
/**
* @param {T} value
* @returns {T}
*/
unwrapOr(value: T): T;
/**
* @template T
* @param {() => T} fn
* @returns {T}
*/
unwrapOrElse<T>(fn: () => T): T;
}
import { Result } from './result.js';
export {};
//# sourceMappingURL=option.d.ts.map

1
types/option.d.ts.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"option.d.ts","sourceRoot":"","sources":["../src/option.js"],"names":[],"mappings":"AAOA;IACE;;;;OAIG;IACH,YAJa,CAAC,SACH,CAAC,GACC,IAAI,CAAC,CAAC,CAAC,CAInB;IAED,sBAAsB;IACtB,qBAEC;IAED;;;;OA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C,CAAC,CAIb;IAED;;;;;;OAMG;IACH,SANa,CAAC,EAAE,CAAC,EACW,CAAC,SAAf,MAAM,CAAC,CAAC,EAAE,CAAC,CAAE,EACJ,CAAC,SAAX,MAAO,CAAE,OACX,CAAC,GACC,CAAC,CAIb;IAED;;;;OAIG;IACH,QAJa,CAAC,OACH,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,OAJa,CAAC,KACD,CAAC,CAKb;IAED;;;OAGG;IACH,gBAHW,CAAC,GACC,CAAC,CAIb;IAED;;;;OAIG;IACH,aAJa,CAAC,MACH,MAAM,CAAC,GACL,CAAC,CAIb;CAMF;uBAtcsB,aAAa"}

251
types/result.d.ts vendored Normal file
View file

@ -0,0 +1,251 @@
export class Result {
/**
* @template T
* @param {T} value
*/
static ok<T>(value: T): Ok<T>;
/**
* @template E
* @param {E} error
*/
static err<E>(error: E): Err<any>;
static chain(fn: any, self: any): any;
static map(fn: any, self: any): any;
static alt(other: any, self: any): any;
static equals(other: any, self: any): any;
static lte(other: any, self: any): any;
}
/** @template T */
export class Ok<T> extends Result {
/** @param {T} value */
constructor(value: T);
/**
* @returns {bool}
*/
isOk(): bool;
/**
* @returns {bool}
*/
isErr(): bool;
/**
* @template E
* @template {Result<T, E>} R
* @param {(value: T) => R} fn
* @returns {R}
*/
andThen<E, R extends Result<T, E>>(fn: (value: T) => R): R;
/**
* @template V, E
* @template {Result<V, E>} R
* @param {(value: T) => V} fn
* @returns {R}
*/
map<V, E, R extends Result<V, E>>(fn: (value: T) => V): R;
/**
* @template V
* @param {V} _defaultValue
* @param {(value: T) => V} fn
* @returns {V}
*/
mapOr<V>(_defaultValue: V, fn: (value: T) => V): V;
/**
* @template E
* @param {Result<T, E>} other
* @returns {Result<T, E>}
*/
and<E>(other: Result<T, E>): Result<T, E>;
/**
* @template E
* @param {Result<T, E>} other
* @returns {Result<T, E>}
*/
or<E>(_other: any): Result<T, E>;
/**
* @template E, F
* @param {(error: E) => Result<T, F>} other
* @returns {Result<T, F>}
*/
orElse<E, F>(_fn: any): Result<T, F>;
/**
* @template E
* @param {Result<T, E>} other
* @returns {bool}
*/
equals<E>(other: Result<T, E>): bool;
/**
* @template E
* @param {Result<T, E>} other
* @returns {bool}
*/
lte<E>(other: Result<T, E>): bool;
/**
* @template [V=T]
* @param {(acc: V, value: T) => V} reducer
* @param {V} init
* @returns {V}
*/
reduce<V = T>(reducer: (acc: V, value: T) => V, init: V): V;
/**
* @template E
* @template {Result<T, E>} R
* @returns {R}
*/
flatten<E, R extends Result<T, E>>(): R;
/**
* @returns {Option<T>}
*/
ok(): Option<T>;
/**
* @returns {Option<T>}
*/
err(): Option<T>;
/**
* @param {(value: T) => void} fn
* @returns {this}
*/
inspect(fn: (value: T) => void): this;
/**
* @returns {T}
* @throws {UnwrapError}
*/
unwrap(): T;
/**
* @returns {E}
* @throws {UnwrapError}
*/
unwrapErr(): E;
/**
* @param {T} _value
* @returns {T}
*/
unwrapOr(_value: T): T;
/**
* @param {() => T} _fn
* @returns {T}
*/
unwrapOrElse(_fn: () => T): T;
#private;
}
/** @template E */
export class Err<E> extends Result {
/** @param {E} value */
constructor(error: any);
/**
* @returns {bool}
*/
isOk(): bool;
/**
* @returns {bool}
*/
isErr(): bool;
/**
* @template T
* @template {Result<T, E>} R
* @param {(value: T) => R} fn
* @returns {R}
*/
andThen<T, R extends Result<T, E>>(_fn: any): R;
/**
* @template V, E
* @template {Result<V, E>} R
* @param {(value: T) => V} _fn
* @returns {R}
*/
map<V, E_1, R extends Result<V, E>>(_fn: (value: T) => V): R;
/**
* @template V
* @param {V} defaultValue
* @param {(value: T) => V} _fn
* @returns {V}
*/
mapOr<V>(defaultValue: V, _fn: (value: T) => V): V;
/**
* @template V
* @param {() => V} defaultFn
* @param {(value: T) => V} _fn
* @returns {V}
*/
mapOrElse<V>(defaultFn: () => V, _fn: (value: T) => V): V;
/**
* @template T
* @param {Result<T, E>} _other
* @returns {Result<T, E>}
*/
and<T>(_other: Result<T, E>): Result<T, E>;
/**
* @template T
* @param {Result<T, E>} other
* @returns {Result<T, E>}
*/
or<T>(other: Result<T, E>): Result<T, E>;
/**
* @template T, F
* @param {(error: E) => Result<T, F>} other
* @returns {Result<T, F>}
*/
orElse<T, F>(fn: any): Result<T, F>;
/**
* @template T
* @param {Result<T, E>} other
* @returns {bool}
*/
equals<T>(other: Result<T, E>): bool;
/**
* @template T
* @param {Result<T, E>} other
* @returns {bool}
*/
lte<T>(other: Result<T, E>): bool;
/**
* @template [V=T]
* @param {(acc: V, value: T) => V} _reducer
* @param {V} init
* @returns {V}
*/
reduce<V = T>(_reducer: (acc: V, value: T) => V, init: V): V;
/**
* @template T
* @template {Result<T, E>} R
* @returns {R}
*/
flatten<T, R extends Result<T, E>>(): R;
/**
* @returns {Option<T>}
*/
ok(): Option<T>;
/**
* @returns {Option<T>}
*/
err(): Option<T>;
/**
* @template T
* @param {(value: T) => void} _fn
* @returns {this}
*/
inspect<T>(_fn: (value: T) => void): this;
/**
* @template T
* @returns {T}
* @throws {UnwrapError}
*/
unwrap<T>(): T;
/**
* @returns {E}
* @throws {UnwrapError}
*/
unwrapErr(): E;
/**
* @param {T} value
* @returns {T}
*/
unwrapOr(value: T): T;
/**
* @template T
* @param {() => T} fn
* @returns {T}
*/
unwrapOrElse<T>(fn: () => T): T;
#private;
}
import { Option } from './option.js';
//# sourceMappingURL=result.d.ts.map

1
types/result.d.ts.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.js"],"names":[],"mappings":"AAOA;IACE;;;OAGG;IACH,UAHa,CAAC,SACH,CAAC,SAIX;IAED;;;OAGG;IACH,WAHa,CAAC,SACH,CAAC,YAIX;IAGD,sCAEC;IAED,oCAEC;IAED,uCAEC;IAED,0CAEC;IAED,uCAEC;CACF;AAED,kBAAkB;AAClB,gBADc,CAAC;IAKb,uBAAuB;IACvB,mBADY,CAAC,EAIZ;IAED;;OAEG;IAC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ACH,OAJa,CAAC,SACH,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACV,IAAI,CAIhB;IAED;;;;OAIG;IACH,IAJa,CAAC,SACH,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GACV,IAAI,CAIhB;IAED;;;;;OAKG;IACH,OALc,CAAC,gBACJ,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,QACvB,CAAC,GACC,CAAC,CAIb;IAED;;;;OAIG;IACH,QAJa,CAAC,EACc,CAAC,SAAf,MAAM,CAAC,CAAC,EAAE,CAAC,CAAE,KACd,CAAC,CAQb;IAED;;OAEG;IACH,MAFa,MAAM,CAAC,CAAC,CAAC,CAIrB;IAED;;OAEG;IACH,OAFa,MAAM,CAAC,CAAC,CAAC,CAIrB;IAED;;;;OAIG;IACH,QAJa,CAAC,OACH,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,OAJa,CAAC,KACD,CAAC,CAKb;IAED;;;OAGG;IACH,aAHa,CAAC,CAKb;IAED;;;OAGG;IACH,gBAHW,CAAC,GACC,CAAC,CAIb;IAED;;;;OAIG;IACH,aAJa,CAAC,MACH,MAAM,CAAC,GACL,CAAC,CAIb;;CAMF;uBA7a4B,aAAa"}

3
types/specification/fantasy-land.d.ts vendored Normal file
View file

@ -0,0 +1,3 @@
export const FantasyLand: Specification;
import { Specification } from './index.js';
//# sourceMappingURL=fantasy-land.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"fantasy-land.d.ts","sourceRoot":"","sources":["../../src/specification/fantasy-land.js"],"names":[],"mappings":"AAiBA,wCAAwE;8BAhB1C,YAAY"}

50
types/specification/index.d.ts vendored Normal file
View file

@ -0,0 +1,50 @@
export class Method {
static from(value: any, options: any): Method;
static asStatic(value: any, options: any): Method;
constructor(name: any, method?: any, { isStatic }?: {
isStatic?: boolean;
});
name: any;
method: any;
isStatic: boolean;
bind(target: any, impl: any): void;
clone(): Method;
#private;
}
export class Structure {
constructor(name: any, methods?: any[], dependencies?: any[]);
name: any;
methods: any[];
dependencies: any[];
hasMethod(method: any, options: any): this;
dependsOn(...algebras: any[]): this;
getMethod(name: any): any;
clone(): Structure;
with(aliases: any): Structure;
#private;
}
export class Specification {
constructor(name: any, structures: any);
name: any;
structures: any;
implementedBy(target: any): Implementor;
getOverrides(structs: any): any;
getAllMethods(): any;
#private;
}
export class Implementor {
constructor(target: any, specification?: any);
target: any;
structures: any[];
specification: any;
implements(...structures: any[]): this;
specifiedBy(specification: any): this;
with(aliases: any): void;
}
export class AliasMap {
static from(iterable: any): AliasMap;
constructor(schema?: any);
schema: any;
}
export function implementor(target: any, specification?: any): Implementor;
//# sourceMappingURL=index.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/specification/index.js"],"names":[],"mappings":"AAEA;IAWE,8CAMC;IAED,kDAEC;IAhBD;;OAIC;IARD,UAAI;IACJ,YAAM;IACN,kBAAQ;IA4BR,mCAEC;IAED,gBAEC;;CACF;AAED;IAME,8DAOC;IAZD,UAAI;IACJ,eAAO;IACP,oBAAY;IAYZ,2CASC;IAED,oCAGC;IAED,0BAEC;IAED,mBAKC;IAED,8BAiBC;;CACF;AAmDD;IAKE,wCAiBC;IArBD,UAAI;IACJ,gBAAU;IAsBV,wCAEC;IAED,gCAEC;IAED,qBAEC;;CACF;AAED;IAKE,8CAGC;IAPD,YAAM;IACN,kBAAe;IACf,mBAAa;IAOb,uCAsBC;IAED,sCAGC;IAED,yBAwCC;CACF;AAED;IAOE,qCAUC;IAdD,0BAEC;IAJD,YAAM;CAiBP;AAEM,2EAA4F"}

1
types/specification/static-land.d.ts vendored Normal file
View file

@ -0,0 +1 @@
//# sourceMappingURL=static-land.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"static-land.d.ts","sourceRoot":"","sources":["../../src/specification/static-land.js"],"names":[],"mappings":""}

26
types/specification/structures.d.ts vendored Normal file
View file

@ -0,0 +1,26 @@
export const Setoid: Structure;
export const Ord: Structure;
export const Semigroupoid: Structure;
export const Category: Structure;
export const Semigroup: Structure;
export const Monoid: Structure;
export const Group: Structure;
export const Foldable: Structure;
export const Functor: Structure;
export const Traversable: Structure;
export const Profunctor: Structure;
export const Alt: Structure;
export const Plus: Structure;
export const Apply: Structure;
export const Applicative: Structure;
export const Chain: Structure;
export const ChainRec: Structure;
export const Alternative: Structure;
export const Monad: Structure;
export const Bifunctor: Structure;
export const Extend: Structure;
export const Comonad: Structure;
export const Contravariant: Structure;
export const Filterable: Structure;
import { Structure } from './index.js';
//# sourceMappingURL=structures.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"structures.d.ts","sourceRoot":"","sources":["../../src/specification/structures.js"],"names":[],"mappings":"AAIA,+BAC8B;AAE9B,4BAEoB;AAEpB,qCAC+B;AAE/B,iCAE0B;AAE1B,kCAC8B;AAE9B,+BAEuB;AAEvB,8BAEoB;AAEpB,iCAC8B;AAE9B,gCAC2B;AAE3B,oCAE+B;AAE/B,mCAEqB;AAErB,4BAEqB;AAErB,6BAEiB;AAEjB,8BAEqB;AAErB,oCAEmB;AAEnB,8BAEmB;AAEnB,iCAEmB;AAEnB,oCAC+B;AAE/B,8BACgC;AAEhC,kCAEqB;AAErB,+BAEqB;AAErB,gCAEoB;AAEpB,sCACiC;AAEjC,mCAC8B;0BAzFI,YAAY"}

3
types/utils.d.ts vendored Normal file
View file

@ -0,0 +1,3 @@
export function path(path: any, obj: any): boolean;
export function zip(...xs: any[]): any;
//# sourceMappingURL=utils.d.ts.map

1
types/utils.d.ts.map Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.js"],"names":[],"mappings":"AAAO,mDAcN;AAEM,uCAKN"}