@matechs/morphic
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -12,4 +12,6 @@ import { ModelURI } from "../../model/hkt" | ||
x: X | ||
) => M<X["_R"], E, A> | ||
export declare const AsUOpaque: <A>() => <X extends M_<any, A>>(x: X) => M_<X["_R"], A> | ||
) => M<Parameters<X["_R"]>[0], E, A> | ||
export declare const AsUOpaque: <A>() => <X extends M_<any, A>>( | ||
x: X | ||
) => M_<Parameters<X["_R"]>[0], A> | ||
export interface Summoner<R> extends Summoners<ProgramURI, InterpreterURI, R> { | ||
@@ -16,0 +18,0 @@ <L, A>(F: ProgramType<R, L, A>[ProgramURI]): M<R, L, A> |
@@ -29,5 +29,3 @@ "use strict"; | ||
var core_1 = require("@matechs/morphic-alg/utils/core"); | ||
exports.AsOpaque = function () { return function (x) { | ||
return x; | ||
}; }; | ||
exports.AsOpaque = function () { return function (x) { return x; }; }; | ||
exports.AsUOpaque = function () { return function (x) { return x; }; }; | ||
@@ -34,0 +32,0 @@ exports.summonFor = function (env) { |
@@ -23,3 +23,3 @@ import type { InterpreterURI, InterpreterResult } from "../interpreter-result" | ||
_I: InterpURI | ||
_R: R | ||
_R: (_: R) => void | ||
} | ||
@@ -33,3 +33,3 @@ export declare type SummonerProgURI<X extends Summoners<any, any, any>> = NonNullable< | ||
export declare type SummonerEnv<X extends Summoners<any, any, any>> = NonNullable< | ||
X["_R"] | ||
Parameters<X["_R"]>[0] | ||
> | ||
@@ -36,0 +36,0 @@ export interface MakeSummonerResult<S extends Summoners<any, any, any>> { |
@@ -11,3 +11,3 @@ export declare const assignFunction: <F extends Function, C>(ab: F, c: C) => F & C | ||
export interface InhabitedTypes<R, E, A> { | ||
_R: R | ||
_R: (_: R) => void | ||
_E: E | ||
@@ -18,3 +18,5 @@ _A: A | ||
export declare type EType<X extends InhabitedTypes<any, any, any>> = X["_E"] | ||
export declare type RType<X extends InhabitedTypes<any, any, any>> = X["_R"] | ||
export declare type RType<X extends InhabitedTypes<any, any, any>> = Parameters< | ||
X["_R"] | ||
>[0] | ||
export declare const inhabitTypes: <R, E, A, T>(t: T) => T & InhabitedTypes<R, E, A> |
@@ -12,4 +12,6 @@ import { ModelURI } from "../../model/hkt" | ||
x: X | ||
) => M<X["_R"], E, A> | ||
export declare const AsUOpaque: <A>() => <X extends M_<any, A>>(x: X) => M_<X["_R"], A> | ||
) => M<Parameters<X["_R"]>[0], E, A> | ||
export declare const AsUOpaque: <A>() => <X extends M_<any, A>>( | ||
x: X | ||
) => M_<Parameters<X["_R"]>[0], A> | ||
export interface Summoner<R> extends Summoners<ProgramURI, InterpreterURI, R> { | ||
@@ -16,0 +18,0 @@ <L, A>(F: ProgramType<R, L, A>[ProgramURI]): M<R, L, A> |
@@ -23,3 +23,3 @@ import type { InterpreterURI, InterpreterResult } from "../interpreter-result" | ||
_I: InterpURI | ||
_R: R | ||
_R: (_: R) => void | ||
} | ||
@@ -33,3 +33,3 @@ export declare type SummonerProgURI<X extends Summoners<any, any, any>> = NonNullable< | ||
export declare type SummonerEnv<X extends Summoners<any, any, any>> = NonNullable< | ||
X["_R"] | ||
Parameters<X["_R"]>[0] | ||
> | ||
@@ -36,0 +36,0 @@ export interface MakeSummonerResult<S extends Summoners<any, any, any>> { |
@@ -11,3 +11,3 @@ export declare const assignFunction: <F extends Function, C>(ab: F, c: C) => F & C | ||
export interface InhabitedTypes<R, E, A> { | ||
_R: R | ||
_R: (_: R) => void | ||
_E: E | ||
@@ -18,3 +18,5 @@ _A: A | ||
export declare type EType<X extends InhabitedTypes<any, any, any>> = X["_E"] | ||
export declare type RType<X extends InhabitedTypes<any, any, any>> = X["_R"] | ||
export declare type RType<X extends InhabitedTypes<any, any, any>> = Parameters< | ||
X["_R"] | ||
>[0] | ||
export declare const inhabitTypes: <R, E, A, T>(t: T) => T & InhabitedTypes<R, E, A> |
@@ -1,2 +0,2 @@ | ||
import type { Summoner } from "./batteries/summoner" | ||
import { Summoner } from "./batteries/summoner" | ||
import type { Materialized } from "./batteries/usage/materializer" | ||
@@ -28,9 +28,8 @@ import type { | ||
_: { | ||
[k in "@matechs/morphic/EqURI" & keyof NonNullable<S["_R"]>]: NonNullable< | ||
S["_R"] | ||
>[k] | ||
[k in "@matechs/morphic/EqURI" & | ||
keyof NonNullable<Parameters<S["_R"]>[0]>]: NonNullable<Parameters<S["_R"]>[0]>[k] | ||
} | ||
) => <L, A>( | ||
F: Materialized< | ||
NonNullable<S["_R"]>, | ||
NonNullable<Parameters<S["_R"]>[0]>, | ||
L, | ||
@@ -46,9 +45,8 @@ A, | ||
_: { | ||
[k in "@matechs/morphic/FastCheckURI" & keyof NonNullable<S["_R"]>]: NonNullable< | ||
S["_R"] | ||
>[k] | ||
[k in "@matechs/morphic/FastCheckURI" & | ||
keyof NonNullable<Parameters<S["_R"]>[0]>]: NonNullable<Parameters<S["_R"]>[0]>[k] | ||
} | ||
) => <L, A>( | ||
F: Materialized< | ||
NonNullable<S["_R"]>, | ||
NonNullable<Parameters<S["_R"]>[0]>, | ||
L, | ||
@@ -64,9 +62,8 @@ A, | ||
_: { | ||
[k in "@matechs/morphic/ShowURI" & keyof NonNullable<S["_R"]>]: NonNullable< | ||
S["_R"] | ||
>[k] | ||
[k in "@matechs/morphic/ShowURI" & | ||
keyof NonNullable<Parameters<S["_R"]>[0]>]: NonNullable<Parameters<S["_R"]>[0]>[k] | ||
} | ||
) => <L, A>( | ||
F: Materialized< | ||
NonNullable<S["_R"]>, | ||
NonNullable<Parameters<S["_R"]>[0]>, | ||
L, | ||
@@ -120,1 +117,38 @@ A, | ||
export {} from "./fc/interpreter/unknown" | ||
export declare const make: Summoner<{}>, | ||
makeADT: import("./batteries/usage/tagged-union").TaggedBuilder< | ||
"@matechs/morphic/ProgramURI", | ||
"@matechs/morphic/InterpreterURI", | ||
{} | ||
>, | ||
makeProgram: import("./batteries/usage/program-infer").Define< | ||
"@matechs/morphic/ProgramURI", | ||
{} | ||
> | ||
export declare const deriveEq: <L, A>( | ||
F: Materialized< | ||
{}, | ||
L, | ||
A, | ||
"@matechs/morphic/ProgramURI", | ||
"@matechs/morphic/InterpreterURI" | ||
> | ||
) => import("@matechs/core/Eq").Eq<A> | ||
export declare const deriveShow: <L, A>( | ||
F: Materialized< | ||
{}, | ||
L, | ||
A, | ||
"@matechs/morphic/ProgramURI", | ||
"@matechs/morphic/InterpreterURI" | ||
> | ||
) => import("@matechs/core/Show").Show<A> | ||
export declare const deriveArb: <L, A>( | ||
F: Materialized< | ||
{}, | ||
L, | ||
A, | ||
"@matechs/morphic/ProgramURI", | ||
"@matechs/morphic/InterpreterURI" | ||
> | ||
) => import("fast-check/*").Arbitrary<A> |
@@ -0,1 +1,2 @@ | ||
import { summonFor } from "./batteries/summoner"; | ||
import { modelEqInterpreter } from "./eq"; | ||
@@ -14,1 +15,16 @@ import { modelFcInterpreter } from "./fc"; | ||
export { withFirstMessage, withMessage, withValidate } from "./model"; | ||
// | ||
// Defaults | ||
// | ||
export const { make, makeADT, makeProgram } = | ||
/*#__PURE__*/ | ||
(() => summonFor({}))(); | ||
export const deriveEq = | ||
/*#__PURE__*/ | ||
(() => eqFor(make)({}))(); | ||
export const deriveShow = | ||
/*#__PURE__*/ | ||
(() => showFor(make)({}))(); | ||
export const deriveArb = | ||
/*#__PURE__*/ | ||
(() => arbFor(make)({}))(); |
@@ -1,2 +0,2 @@ | ||
import type { Summoner } from "./batteries/summoner" | ||
import { Summoner } from "./batteries/summoner" | ||
import type { Materialized } from "./batteries/usage/materializer" | ||
@@ -28,9 +28,8 @@ import type { | ||
_: { | ||
[k in "@matechs/morphic/EqURI" & keyof NonNullable<S["_R"]>]: NonNullable< | ||
S["_R"] | ||
>[k] | ||
[k in "@matechs/morphic/EqURI" & | ||
keyof NonNullable<Parameters<S["_R"]>[0]>]: NonNullable<Parameters<S["_R"]>[0]>[k] | ||
} | ||
) => <L, A>( | ||
F: Materialized< | ||
NonNullable<S["_R"]>, | ||
NonNullable<Parameters<S["_R"]>[0]>, | ||
L, | ||
@@ -46,9 +45,8 @@ A, | ||
_: { | ||
[k in "@matechs/morphic/FastCheckURI" & keyof NonNullable<S["_R"]>]: NonNullable< | ||
S["_R"] | ||
>[k] | ||
[k in "@matechs/morphic/FastCheckURI" & | ||
keyof NonNullable<Parameters<S["_R"]>[0]>]: NonNullable<Parameters<S["_R"]>[0]>[k] | ||
} | ||
) => <L, A>( | ||
F: Materialized< | ||
NonNullable<S["_R"]>, | ||
NonNullable<Parameters<S["_R"]>[0]>, | ||
L, | ||
@@ -64,9 +62,8 @@ A, | ||
_: { | ||
[k in "@matechs/morphic/ShowURI" & keyof NonNullable<S["_R"]>]: NonNullable< | ||
S["_R"] | ||
>[k] | ||
[k in "@matechs/morphic/ShowURI" & | ||
keyof NonNullable<Parameters<S["_R"]>[0]>]: NonNullable<Parameters<S["_R"]>[0]>[k] | ||
} | ||
) => <L, A>( | ||
F: Materialized< | ||
NonNullable<S["_R"]>, | ||
NonNullable<Parameters<S["_R"]>[0]>, | ||
L, | ||
@@ -120,1 +117,38 @@ A, | ||
export {} from "./fc/interpreter/unknown" | ||
export declare const make: Summoner<{}>, | ||
makeADT: import("./batteries/usage/tagged-union").TaggedBuilder< | ||
"@matechs/morphic/ProgramURI", | ||
"@matechs/morphic/InterpreterURI", | ||
{} | ||
>, | ||
makeProgram: import("./batteries/usage/program-infer").Define< | ||
"@matechs/morphic/ProgramURI", | ||
{} | ||
> | ||
export declare const deriveEq: <L, A>( | ||
F: Materialized< | ||
{}, | ||
L, | ||
A, | ||
"@matechs/morphic/ProgramURI", | ||
"@matechs/morphic/InterpreterURI" | ||
> | ||
) => import("@matechs/core/Eq").Eq<A> | ||
export declare const deriveShow: <L, A>( | ||
F: Materialized< | ||
{}, | ||
L, | ||
A, | ||
"@matechs/morphic/ProgramURI", | ||
"@matechs/morphic/InterpreterURI" | ||
> | ||
) => import("@matechs/core/Show").Show<A> | ||
export declare const deriveArb: <L, A>( | ||
F: Materialized< | ||
{}, | ||
L, | ||
A, | ||
"@matechs/morphic/ProgramURI", | ||
"@matechs/morphic/InterpreterURI" | ||
> | ||
) => import("fast-check/*").Arbitrary<A> |
27
index.js
"use strict"; | ||
var _a; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.showFor = exports.arbFor = exports.eqFor = void 0; | ||
exports.deriveArb = exports.deriveShow = exports.deriveEq = exports.makeProgram = exports.makeADT = exports.make = exports.showFor = exports.arbFor = exports.eqFor = void 0; | ||
var summoner_1 = require("./batteries/summoner"); | ||
var eq_1 = require("./eq"); | ||
var fc_1 = require("./fc"); | ||
var show_1 = require("./show"); | ||
var summoner_1 = require("./batteries/summoner"); | ||
Object.defineProperty(exports, "opaque", { enumerable: true, get: function () { return summoner_1.AsOpaque; } }); | ||
Object.defineProperty(exports, "opaque_", { enumerable: true, get: function () { return summoner_1.AsUOpaque; } }); | ||
Object.defineProperty(exports, "makeFor", { enumerable: true, get: function () { return summoner_1.summonFor; } }); | ||
var summoner_2 = require("./batteries/summoner"); | ||
Object.defineProperty(exports, "opaque", { enumerable: true, get: function () { return summoner_2.AsOpaque; } }); | ||
Object.defineProperty(exports, "opaque_", { enumerable: true, get: function () { return summoner_2.AsUOpaque; } }); | ||
Object.defineProperty(exports, "makeFor", { enumerable: true, get: function () { return summoner_2.summonFor; } }); | ||
var hkt_1 = require("./eq/hkt"); | ||
@@ -28,1 +30,16 @@ Object.defineProperty(exports, "EqURI", { enumerable: true, get: function () { return hkt_1.EqURI; } }); | ||
Object.defineProperty(exports, "withValidate", { enumerable: true, get: function () { return model_1.withValidate; } }); | ||
// | ||
// Defaults | ||
// | ||
exports.make = (_a = | ||
/*#__PURE__*/ | ||
(function () { return summoner_1.summonFor({}); })(), _a.make), exports.makeADT = _a.makeADT, exports.makeProgram = _a.makeProgram; | ||
exports.deriveEq = | ||
/*#__PURE__*/ | ||
(function () { return exports.eqFor(exports.make)({}); })(); | ||
exports.deriveShow = | ||
/*#__PURE__*/ | ||
(function () { return exports.showFor(exports.make)({}); })(); | ||
exports.deriveArb = | ||
/*#__PURE__*/ | ||
(function () { return exports.arbFor(exports.make)({}); })(); |
{ | ||
"name": "@matechs/morphic", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
431267
11892