functype 1.9.0 → 1.10.0
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/README.md +34 -1
- package/dist/Wire-3hvw0Ogg.d.ts +42 -0
- package/dist/cli/exports.d.ts +6 -6
- package/dist/cli/exports.js +1 -1
- package/dist/cli/index.js +5 -5
- package/dist/conditional/index.d.ts +1 -1
- package/dist/conditional/index.js +1 -1
- package/dist/core/task/index.d.ts +1 -1
- package/dist/core/task/index.js +1 -1
- package/dist/decoder/index.d.ts +1 -1
- package/dist/decoder/index.js +1 -1
- package/dist/do/index.d.ts +1 -1
- package/dist/do/index.js +1 -1
- package/dist/either/index.d.ts +1 -1
- package/dist/either/index.js +1 -1
- package/dist/fetch/index.d.ts +1 -1
- package/dist/fetch/index.js +1 -1
- package/dist/{full-interfaces-5E1X7vP5.js → full-interfaces-DfXPHnm3.js} +1 -1
- package/dist/functype/index.d.ts +1 -1
- package/dist/{index-CIS_THnu.d.ts → index-CEUB9MHA.d.ts} +102 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/io/index.d.ts +1 -1
- package/dist/io/index.js +1 -1
- package/dist/lazy/index.d.ts +1 -1
- package/dist/lazy/index.js +1 -1
- package/dist/list/index.d.ts +1 -1
- package/dist/list/index.js +1 -1
- package/dist/map/index.d.ts +1 -1
- package/dist/map/index.js +1 -1
- package/dist/obj/index.d.ts +1 -1
- package/dist/obj/index.js +1 -1
- package/dist/option/index.d.ts +1 -1
- package/dist/option/index.js +1 -1
- package/dist/serialization/index.d.ts +1 -1
- package/dist/serialization/index.js +1 -1
- package/dist/serialization-CpbxaV0t.js +4 -0
- package/dist/set/index.d.ts +1 -1
- package/dist/set/index.js +1 -1
- package/dist/src-Bpdfpk6R.js +17 -0
- package/dist/try/index.d.ts +1 -1
- package/dist/try/index.js +1 -1
- package/dist/tuple/index.js +1 -1
- package/dist/typeclass/index.d.ts +1 -1
- package/dist/util/index.d.ts +2 -3
- package/dist/wire/index.d.ts +2 -2
- package/package.json +10 -10
- package/dist/Wire-DNwezIvG.d.ts +0 -30
- package/dist/serialization-my_TLROv.js +0 -4
- package/dist/src-i6unVIl3.js +0 -17
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ npx functype --json # JSON output for programmatic use
|
|
|
52
52
|
- **Reach for functype** when you want Scala's standard-library ergonomics — `Option`, `Either`, `Try`, `List`, do-notation — with **zero runtime dependencies**, adoptable **one function at a time** (a `List` or `Option` is just a value you can delete from a single file). It includes a lightweight ZIO-shaped `IO` with typed errors and DI, but no runtime to build your app around.
|
|
53
53
|
- **Reach for Effect** when you want **structured concurrency**, streaming, scheduling, and an integrated batteries-included ecosystem you structure your whole application on.
|
|
54
54
|
|
|
55
|
-
functype deliberately is **not** a framework — no fiber runtime, no structured concurrency, no `Clock`/`Random
|
|
55
|
+
functype deliberately is **not** a framework — no fiber runtime, no structured concurrency, no `Clock`/`Random`. What it adds instead is an **LLM-native** loop no other FP library has: lint rules that _enforce_ idioms ([`eslint-plugin-functype`](https://www.npmjs.com/package/eslint-plugin-functype)), a scorer/benchmark that _measures_ adherence ([`functype-eval`](https://www.npmjs.com/package/functype-eval)), and an MCP server + skill that _teach_ models the API.
|
|
56
56
|
|
|
57
57
|
**Full comparison, non-goals, and "choose Effect when…": [docs/vs-effect.md](./docs/vs-effect.md).**
|
|
58
58
|
|
|
@@ -379,6 +379,35 @@ getUserByEmail("invalid") // Type error: Argument of type 'string' is not assign
|
|
|
379
379
|
getUserByEmail(userId) // Type error: Argument of type 'UserId' is not assignable to parameter of type 'Email'
|
|
380
380
|
```
|
|
381
381
|
|
|
382
|
+
### Wire — serialization boundaries
|
|
383
|
+
|
|
384
|
+
`Wire<T>` marks a value in its serialization-safe shape: a DB row, an HTTP body, a JSONB payload. Zero runtime, assignable both ways with `T`, and the ESLint plugin's `prefer-option` / `prefer-list` skip everything inside it.
|
|
385
|
+
|
|
386
|
+
```typescript
|
|
387
|
+
import type { Wire } from "functype"
|
|
388
|
+
|
|
389
|
+
type UserRow = Wire<{ readonly email: string | null; readonly tags: ReadonlyArray<string> }>
|
|
390
|
+
type UserRows = Wire<ReadonlyArray<UserRow>>
|
|
391
|
+
|
|
392
|
+
// Convert inside the pipeline
|
|
393
|
+
const reachable = List(rows).filter((u) => Option(u.email).isSome())
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### TracedOption — code-path introspection
|
|
397
|
+
|
|
398
|
+
Opt-in wrapper that emits one structured event per Option combinator to an injected `Tracer`:
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
import { TracedOption, type Tracer, type TraceEvent } from "functype"
|
|
402
|
+
|
|
403
|
+
const events: TraceEvent[] = []
|
|
404
|
+
const tracer: Tracer = { emit: (e) => void events.push(e) }
|
|
405
|
+
|
|
406
|
+
TracedOption(user, tracer, "span-1")
|
|
407
|
+
.map((u) => u.name.trim(), "trim")
|
|
408
|
+
.orElse("anonymous", "fallback")
|
|
409
|
+
```
|
|
410
|
+
|
|
382
411
|
## Conditional Programming
|
|
383
412
|
|
|
384
413
|
Functype provides `Cond` and `Match` for functional conditional logic without early returns:
|
|
@@ -662,6 +691,10 @@ opt.forEach(console.log) // Logs: 42
|
|
|
662
691
|
list.forEach(console.log) // Logs: 1, 2, 3, 4, 5
|
|
663
692
|
```
|
|
664
693
|
|
|
694
|
+
## ESLint Plugin
|
|
695
|
+
|
|
696
|
+
[`eslint-plugin-functype`](https://functype.org/eslint) enforces these patterns. `recommended` fails the build on the rules that are reliably right (loops, `let`, native `Map`/`Set` you only read, `isSome()` branching) and warns on the rest. Declare boundaries with `Wire<T>`, `@interop` and `@invariant` instead of `eslint-disable`.
|
|
697
|
+
|
|
665
698
|
## Feature Matrix
|
|
666
699
|
|
|
667
700
|
For a comprehensive overview of which interfaces are supported by each data structure, see the [Functype Feature Matrix](docs/FUNCTYPE_FEATURE_MATRIX.md).
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//#region src/wire/Wire.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A value in its serialization-safe shape — a DB row, an HTTP body, a JSONB payload, a workflow
|
|
4
|
+
* input. Wraps ANY boundary shape: a collection (`Wire<ReadonlyArray<Row>>`), a nullable field
|
|
5
|
+
* (`Wire<string | null>`), or a whole row/DTO type (`Wire<Row>`), which covers every field inside it.
|
|
6
|
+
*
|
|
7
|
+
* `null` is the shape that survives `JSON.stringify`; `Option` and `List` are not. Inside the code that
|
|
8
|
+
* transforms these values, convert with `Option(x)` / `List(xs)`.
|
|
9
|
+
*
|
|
10
|
+
* Zero runtime, zero type-level enforcement. `Wire<T>` is `T | (T & WireMark)`: the plain `T` member
|
|
11
|
+
* keeps it assignable both ways with `T` — including `null`, `undefined` and `unknown` — so call sites
|
|
12
|
+
* need no casts, and generic helpers like `findOne<R>(): Promise<Wire<R | null>>` compile. The branded
|
|
13
|
+
* member exists so TypeScript keeps the alias name instead of resolving it eagerly: inferred exports
|
|
14
|
+
* emit `Wire<Row>` in `.d.ts` files and hovers, rather than a type that names an unexported symbol
|
|
15
|
+
* (which fails a consumer's declaration build with TS4023).
|
|
16
|
+
*
|
|
17
|
+
* Value lives in three places:
|
|
18
|
+
* - `rg 'Wire<'` is the countable inventory of serialization boundaries;
|
|
19
|
+
* - the name documents intent at the declaration site;
|
|
20
|
+
* - `functype/prefer-list` and `functype/prefer-option` skip everything inside a `Wire<…>` type
|
|
21
|
+
* argument (`wireTypes` option, default `["Wire"]`), so the boundary is declared once instead of
|
|
22
|
+
* suppressed at every field.
|
|
23
|
+
*
|
|
24
|
+
* Consumer aliases compose: `type UserRow = Wire<{ … }>` — uses of `UserRow` pass the linter, and the
|
|
25
|
+
* alias declaration is the one place the boundary is stated.
|
|
26
|
+
*
|
|
27
|
+
* Migration from 1.9: `Wire<Row>` meant `ReadonlyArray<Row>`; write `Wire<ReadonlyArray<Row>>`. The
|
|
28
|
+
* change is compile-loud except for `Wire<object>` and `Wire<any>`, which accept an array either way.
|
|
29
|
+
*
|
|
30
|
+
* @category Wire
|
|
31
|
+
*/
|
|
32
|
+
declare const WIRE: unique symbol;
|
|
33
|
+
/**
|
|
34
|
+
* The phantom mark that keeps `Wire<T>` a named alias through inference and declaration emit.
|
|
35
|
+
* Exported so emitted declarations can name it; never needed in user code.
|
|
36
|
+
*/
|
|
37
|
+
interface WireMark {
|
|
38
|
+
readonly [WIRE]?: never;
|
|
39
|
+
}
|
|
40
|
+
type Wire<T> = T | (T & WireMark);
|
|
41
|
+
//#endregion
|
|
42
|
+
export { WireMark as n, Wire as t };
|
package/dist/cli/exports.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* lives in the interface body, not via `extends Functor`). The data-sync
|
|
9
9
|
* spec enforces that no source-declared interface is dropped from this list.
|
|
10
10
|
*/
|
|
11
|
-
declare const VERSION: string;
|
|
11
|
+
export declare const VERSION: string;
|
|
12
12
|
interface TypeData {
|
|
13
13
|
description: string;
|
|
14
14
|
interfaces: string[];
|
|
@@ -25,9 +25,9 @@ interface InterfaceData {
|
|
|
25
25
|
description: string;
|
|
26
26
|
methods: string[];
|
|
27
27
|
}
|
|
28
|
-
declare const TYPES: Record<string, TypeData>;
|
|
29
|
-
declare const INTERFACES: Record<string, InterfaceData>;
|
|
30
|
-
declare const CATEGORIES: {
|
|
28
|
+
export declare const TYPES: Record<string, TypeData>;
|
|
29
|
+
export declare const INTERFACES: Record<string, InterfaceData>;
|
|
30
|
+
export declare const CATEGORIES: {
|
|
31
31
|
Core: string[];
|
|
32
32
|
Collection: string[];
|
|
33
33
|
Effect: string[];
|
|
@@ -43,6 +43,6 @@ declare const CATEGORIES: {
|
|
|
43
43
|
* Generated by scripts/extract-interfaces.ts
|
|
44
44
|
* DO NOT EDIT MANUALLY
|
|
45
45
|
*/
|
|
46
|
-
declare const FULL_INTERFACES: Record<string, string>;
|
|
46
|
+
export declare const FULL_INTERFACES: Record<string, string>;
|
|
47
47
|
//#endregion
|
|
48
|
-
export {
|
|
48
|
+
export type { InterfaceData, TypeData };
|
package/dist/cli/exports.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,i as t,n,r,t as i}from"../full-interfaces-
|
|
1
|
+
import{a as e,i as t,n,r,t as i}from"../full-interfaces-DfXPHnm3.js";export{n as CATEGORIES,i as FULL_INTERFACES,r as INTERFACES,t as TYPES,e as VERSION};
|
package/dist/cli/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
3
|
-
`)},l=(
|
|
4
|
-
`).trimEnd()},u=()=>{let e=
|
|
5
|
-
`).trimEnd()},d=e=>JSON.stringify(e,null,2),f=()=>({version:r,categories:a,types:i}),p=e
|
|
2
|
+
import{Mt as e,et as t,wt as n}from"../src-Bpdfpk6R.js";import{a as r,i,n as a,r as o,t as s}from"../full-interfaces-DfXPHnm3.js";const c=()=>{let t=n([`functype ${r} - Scala-inspired FP for TypeScript`,``]);return n(Object.entries(a)).foldLeft(t)((t,[r,a])=>{let o=t.add(r.toUpperCase());return n(a).foldLeft(o)((t,n)=>e(i[n]).fold(()=>t,e=>{let r=e.interfaces.length>0?` [${e.interfaces.join(`, `)}]`:``;return t.add(` ${n}${r}`).add(` ${e.description}`)})).add(``)}).concat(n([`Use: npx functype <Type> for details`,`Use: npx functype interfaces for interface reference`])).toArray().join(`
|
|
3
|
+
`)},l=(t,r)=>{let i=r.interfaces.length>0?` [${r.interfaces.join(`, `)}]`:``,a=n([`create`,`transform`,`extract`,`check`,`other`]),o=n([`${t}<T>${i}`,``,r.description,``]);return a.foldLeft(o)((t,i)=>e(r.methods[i]).filter(e=>e.length>0).fold(()=>t,e=>{let r=t.add(i.toUpperCase());return n(e).foldLeft(r)((e,t)=>e.add(` ${t}`)).add(``)})).toArray().join(`
|
|
4
|
+
`).trimEnd()},u=()=>{let e=n([`INTERFACES`,``]);return n(Object.entries(o)).foldLeft(e)((e,[t,r])=>{let i=r.extends?` extends ${r.extends}`:``,a=e.add(`${t}<A>${i}`).add(` ${r.description}`);return n(r.methods).foldLeft(a)((e,t)=>e.add(` ${t}`)).add(``)}).toArray().join(`
|
|
5
|
+
`).trimEnd()},d=e=>JSON.stringify(e,null,2),f=()=>({version:r,categories:a,types:i}),p=t=>e(i[t]).map(e=>({name:t,data:e})).or(n(Object.entries(i)).find(([e])=>e.toLowerCase()===t.toLowerCase()).map(([e,t])=>({name:e,data:t}))).orUndefined(),m=()=>Object.keys(i),h=()=>o,g=e=>{let t=n(e.slice(2));return{flags:{json:t.contains(`--json`),full:t.contains(`--full`),help:t.exists(e=>e===`--help`||e===`-h`)},args:t.filter(e=>!e.startsWith(`--`)&&e!==`-h`)}},_=t=>e(s[t]).or(n(Object.entries(s)).find(([e])=>e.toLowerCase()===t.toLowerCase()).map(([,e])=>e)),v=()=>{let e=n([`FULL INTERFACE DEFINITIONS`,`=`.repeat(60),``]);return n(Object.entries(s)).foldLeft(e)((e,[t,r])=>e.concat(n([`// ${t}`,r,``,`-`.repeat(60),``]))).toArray().join(`
|
|
6
6
|
`).trimEnd()},y=()=>{console.log(`functype - API documentation for LLMs
|
|
7
7
|
|
|
8
8
|
USAGE
|
|
@@ -24,4 +24,4 @@ EXAMPLES
|
|
|
24
24
|
npx functype Option --json # Option as JSON
|
|
25
25
|
npx functype Option --full # Full TypeScript interface
|
|
26
26
|
npx functype --full # All full interfaces (large output!)
|
|
27
|
-
`)},b=e=>{console.error(`Unknown type: ${e}`),console.error(``),console.error(`Available types: ${m().join(`, `)}`),console.error(``),console.error(`Use: npx functype interfaces - for interface reference`),process.exit(1)},x=e=>console.log(e),S=(
|
|
27
|
+
`)},b=e=>{console.error(`Unknown type: ${e}`),console.error(``),console.error(`Available types: ${m().join(`, `)}`),console.error(``),console.error(`Use: npx functype interfaces - for interface reference`),process.exit(1)},x=e=>console.log(e),S=(t,n)=>e(p(t)).fold(()=>b(t),e=>{n.full?_(e.name).fold(()=>x(n.json?d({[e.name]:e.data}):l(e.name,e.data)),t=>x(n.json?d({[e.name]:{...e.data,fullInterface:t}}):t)):x(n.json?d({[e.name]:e.data}):l(e.name,e.data))});(()=>{let{flags:e,args:n}=g(process.argv);t(!0).when(()=>e.help,()=>y()).when(()=>n.isEmpty,()=>e.full?x(e.json?d(s):v()):x(e.json?d(f()):c())).when(()=>n.headOption.contains(`interfaces`),()=>x(e.json?d(h()):u())).default(()=>n.headOption.fold(()=>x(e.json?d(f()):c()),t=>S(t,e)))})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jr as Cond, n as UntypedMatch, t as Match } from "../index-CEUB9MHA.js";
|
|
2
2
|
export { Cond, Match, UntypedMatch };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{et as e,tt as t}from"../src-Bpdfpk6R.js";export{t as Cond,e as Match};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $t as
|
|
1
|
+
import { $t as TaggedThrowable, Jt as CancellationToken, Qt as Sync, Xt as Err, Yt as CancellationTokenSource, Zt as Ok, an as TaskResult, cn as isTaggedThrowable, en as Task, in as TaskParams, nn as TaskMetadata, on as TaskSuccess, qt as Async, rn as TaskOutcome, sn as createCancellationTokenSource, tn as TaskFailure } from "../../index-CEUB9MHA.js";
|
|
2
2
|
export { Async, CancellationToken, CancellationTokenSource, Err, Ok, Sync, TaggedThrowable, Task, TaskFailure, TaskMetadata, TaskOutcome, TaskParams, TaskResult, TaskSuccess, createCancellationTokenSource, isTaggedThrowable };
|
package/dist/core/task/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{J as e,K as t,X as n,Y as r,q as i}from"../../src-Bpdfpk6R.js";export{t as Err,i as Ok,e as Task,r as createCancellationTokenSource,n as isTaggedThrowable};
|
package/dist/decoder/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gt as DecoderErrorComposite, Kt as DecoderErrorLeaf, Ut as Decoder, Wt as DecoderError } from "../index-CEUB9MHA.js";
|
|
2
2
|
export { Decoder, DecoderError, type DecoderErrorComposite, type DecoderErrorLeaf };
|
package/dist/decoder/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as e,
|
|
1
|
+
import{H as e,U as t}from"../src-Bpdfpk6R.js";export{e as Decoder,t as DecoderError};
|
package/dist/do/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ar as Doable, Bt as NoneError, Ft as EmptyListError, Ht as unwrap, It as FailureError, Lt as FailureErrorType, Mt as Do, Nt as DoAsync, Pt as DoGenerator, Rt as LeftError, Vt as isDoCapable, jt as $, kr as DoResult, zt as LeftErrorType } from "../index-CEUB9MHA.js";
|
|
2
2
|
export { $, Do, DoAsync, DoGenerator, type DoResult, type Doable, EmptyListError, FailureError, FailureErrorType, LeftError, LeftErrorType, NoneError, isDoCapable, unwrap };
|
package/dist/do/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,F as t,I as n,L as r,
|
|
1
|
+
import{B as e,F as t,I as n,L as r,N as i,P as a,R as o,V as s,z as c}from"../src-Bpdfpk6R.js";export{i as $,a as Do,t as DoAsync,n as EmptyListError,r as FailureError,o as LeftError,c as NoneError,e as isDoCapable,s as unwrap};
|
package/dist/either/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ar as Left, cr as RightOf, dr as TypeCheckRight, fr as isLeft, hr as tryCatchAsync, ir as EitherBase, lr as TestEither, mr as tryCatch, or as LeftOf, pr as isRight, rr as Either, sr as Right, ur as TypeCheckLeft } from "../index-CEUB9MHA.js";
|
|
2
2
|
export { Either, EitherBase, Left, LeftOf, Right, RightOf, TestEither, TypeCheckLeft, TypeCheckRight, isLeft, isRight, tryCatch, tryCatchAsync };
|
package/dist/either/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ct as e,St as t,_t as n,bt as r,gt as i,ht as a,vt as o,xt as s,yt as c}from"../src-Bpdfpk6R.js";export{a as Either,i as Left,n as Right,o as TypeCheckLeft,c as TypeCheckRight,r as isLeft,s as isRight,t as tryCatch,e as tryCatchAsync};
|
package/dist/fetch/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as Http, B as HttpError, F as HttpRequestOptions, H as HttpStatusError, I as HttpRequestView, L as HttpResponse, M as HttpClientConfig, N as HttpMethodOptions, P as HttpQueryParams, R as ParseMode, U as NetworkError, V as HttpMethod, W as ResponseDecodeError, j as HttpClient, z as DecodeError } from "../index-CEUB9MHA.js";
|
|
2
2
|
export { type DecodeError, Http, HttpClient, type HttpClientConfig, type HttpError, HttpError as HttpErrors, type HttpMethod, type HttpMethodOptions, type HttpQueryParams, type HttpRequestOptions, type HttpRequestView, type HttpResponse, type HttpStatusError, type NetworkError, type ParseMode, type ResponseDecodeError };
|
package/dist/fetch/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,f as t,
|
|
1
|
+
import{d as e,f as t,p as n}from"../src-Bpdfpk6R.js";export{e as Http,n as HttpClient,t as HttpErrors};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=`1.9.0`;const t={Option:[`Applicative`,`AsyncMonad`,`Doable`,`Extractable`,`Foldable`,`Functor`,`Matchable`,`Monad`,`Promisable`,`Reshapeable`,`Serializable`,`Traversable`],Either:[`Applicative`,`AsyncMonad`,`Doable`,`Extractable`,`Foldable`,`Functor`,`Monad`,`Promisable`,`Reshapeable`,`Serializable`],Try:[`Applicative`,`AsyncMonad`,`Doable`,`Extractable`,`Foldable`,`Functor`,`Monad`,`Promisable`,`Reshapeable`,`Serializable`],List:[`Collection`,`Doable`,`Iterable`,`Reshapeable`],Set:[`Collection`,`Iterable`],Map:[`Collection`,`Foldable`,`Iterable`,`KVTraversable`,`Serializable`],Obj:[`Doable`,`Promisable`,`Reshapeable`],Lazy:[`Applicative`,`AsyncMonad`,`Extractable`,`Foldable`,`Functor`,`Monad`,`Serializable`,`Traversable`],LazyList:[`Foldable`,`Serializable`],Tuple:[`Foldable`,`Serializable`],Task:[`Applicative`,`AsyncMonad`,`Doable`,`Extractable`,`Foldable`,`Functor`,`Monad`,`Promisable`,`Serializable`,`Traversable`]},n=e,r=(e,...n)=>Array.from(new Set([...t[e],...n])).sort(),i={Option:{description:`Safe nullable handling - Some<T> or None`,interfaces:r(`Option`),methods:{create:[`Option(v)`,`Option.none()`,`Some(v)`,`None()`],transform:[`.map(f)`,`.flatMap(f)`,`.filter(p)`,`.ap(ff)`],extract:[`.fold(n, s)`,`.foldAsync(n, s)`,`.orElse(d)`,`.orThrow()`,`.expect(() => never)`,`.orNull()`,`.match({Some, None})`,`.toEither(left | () => left)`,`.toList()`,`.toArray()`],check:[`.isSome()`,`.isNone()`,`.isEmpty`],other:[`Option.sequence(arr)`,`Option.traverse(arr, f)`]}},Either:{description:`Error handling with Left (error) or Right (success)`,interfaces:r(`Either`,`Traversable`),methods:{create:[`Right(v)`,`Left(e)`,`Either.right(v)`,`Either.left(e)`,`Either.void()`],transform:[`.map(f)`,`.flatMap(f)`,`.mapLeft(f)`,`.swap()`],extract:[`.fold(l, r)`,`.foldAsync(l, r)`,`.orElse(d)`,`.orThrow()`,`.expect((l) => never)`,`.match({Left, Right})`],check:[`.isRight()`,`.isLeft()`],other:[`Either.sequence(arr)`,`Either.traverse(arr, f)`,`Either.fromNullable(v, e)`]}},Try:{description:`Wrap operations that may throw - Success<T> or Failure`,interfaces:r(`Try`,`Matchable`,`Traversable`),methods:{create:[`Try(() => expr)`,`Try.success(v)`,`Try.failure(e)`,`Try.fromPromise(p)`,`Try.async(() => Promise<T>)`],transform:[`.map(f)`,`.flatMap(f)`,`.recover(f)`,`.recoverWith(f)`],extract:[`.fold(f, s)`,`.foldAsync(f, s)`,`.orElse(d)`,`.orThrow()`,`.expect((e) => never)`,`.toOption()`,`.toEither(left | (err) => left)`,`.toList()`,`.toArray()`],check:[`.isSuccess()`,`.isFailure()`],other:[`Try.sequence(arr)`,`Try.traverse(arr, f)`]}},List:{description:`Immutable array with functional operations`,interfaces:r(`List`,`Functor`,`Monad`,`Foldable`,`Serializable`,`Traversable`),methods:{create:[`List([...])`,`List.of(...)`,`List.empty()`],transform:[`.map(f)`,`.flatMap(f)`,`.filter(p)`,`.take(n)`,`.takeWhile(p)`,`.takeRight(n)`,`.drop(n)`,`.dropWhile(p)`,`.concat(list)`,`.reverse()`,`.distinct()`,`.sorted()`,`.sortBy(f)`,`.zip(list)`,`.zipWithIndex()`,`.prepend(v)`,`.slice(s, e)`],extract:[`.fold(z, f)`,`.reduce(f)`,`.head`,`.headOption`,`.tail`,`.last`,`.lastOption`,`.init`,`.indexOf(v)`,`.toArray()`],check:[`.isEmpty`,`.nonEmpty`,`.size`,`.contains(v)`],other:[`.groupBy(f)`,`.partition(p)`,`.span(p)`]}},Set:{description:`Immutable set of unique values`,interfaces:r(`Set`,`Functor`,`Foldable`,`Serializable`,`Traversable`),methods:{create:[`Set([...])`,`Set.of(...)`,`Set.empty()`],transform:[`.map(f)`,`.filter(p)`,`.union(s)`,`.intersection(s)`,`.difference(s)`,`.add(v)`],extract:[`.fold(z, f)`,`.toArray()`],check:[`.has(v)`,`.isEmpty`,`.size`]}},Obj:{description:`Immutable object wrapper with fluent operations`,interfaces:r(`Obj`,`KVTraversable`,`Foldable`,`Matchable`,`Extractable`,`Serializable`),methods:{create:[`Obj({...})`,`Obj.of({...})`,`Obj.empty()`],transform:[`.set(k, v)`,`.assign(partial)`,`.merge(obj)`,`.when(cond, partial)`,`.omit(...keys)`,`.pick(...keys)`,`.map(f)`,`.flatMap(f)`],extract:[`.get(k)`,`.value()`,`.keys()`,`.values()`,`.entries()`,`.fold(n, s)`,`.match({Obj})`],check:[`.has(k)`,`.isEmpty`,`.size`]}},Map:{description:`Immutable key-value store`,interfaces:r(`Map`),methods:{create:[`Map([[k, v], ...])`,`Map.of([k, v], ...)`,`Map.empty()`],transform:[`.set(k, v)`,`.delete(k)`,`.map(f)`,`.filter(p)`,`.add(k, v)`],extract:[`.get(k)`,`.keys()`,`.values()`,`.entries()`,`.fold(z, f)`],check:[`.has(k)`,`.isEmpty`,`.size`]}},Lazy:{description:"Deferred computation with memoization. Note: `serialize()` and `toValue()` FORCE the thunk (visible side effect) since a closure cannot be JSON-serialized — there is no representable 'unevaluated post-serialize' state. Thunk failures are captured via SerializedError and rethrown on access after fromJSON.",interfaces:r(`Lazy`),methods:{create:[`Lazy(() => expr)`,`Lazy.fromValue(value) — wrap a non-deferred value`,`Lazy.evaluated(value) — reads as 'already-forced'; used by fromJSON`,`Lazy.fail(error) — Lazy that throws on access`],transform:[`.map(f)`,`.flatMap(f)`],extract:[`.fold(n, s)`,`.orElse(d)`,`.orThrow()`,`.get()`,`.toJSON()`,`Lazy.fromJSON(json)`],check:[`.isEvaluated`]}},LazyList:{description:`Lazy sequences for large/infinite data`,interfaces:r(`LazyList`,`Functor`,`Monad`,`Iterable`),methods:{create:[`LazyList.from(iter)`,`LazyList.range(start, end)`,`LazyList.infinite(f)`,`LazyList.fromJSON(json)`],transform:[`.map(f)`,`.filter(p)`,`.take(n)`,`.takeRight(n)`,`.drop(n)`,`.takeWhile(p)`,`.dropWhile(p)`,`.concat(ll)`,`.reverse()`,`.distinct()`,`.zip(ll)`,`.zipWithIndex()`],extract:[`.head`,`.headOption`,`.tail`,`.last`,`.lastOption`,`.init`,`.toArray()`,`.toJSON()`],check:[`.isEmpty`]}},Task:{description:`Async operations with cancellation and progress tracking. Returns TaskOutcome<T> (Ok/Err) which implements Functor, AsyncMonad, Foldable, Extractable, Serializable`,interfaces:r(`Task`),methods:{create:[`Task(params).Async(fn, errFn)`,`Task(params).Sync(fn, errFn)`,`Task.ok(value)`,`Task.err(error)`,`Task.fromEither(either)`,`Task.fromTry(try)`,`Task.fromPromise(fn)`,`Task.fromNodeCallback(fn)`,`Task.fromJSON(json) — reconstruct from serialize() output`],transform:[`.map(f)`,`.flatMap(f)`,`.mapError(f)`,`.recover(v)`,`.recoverWith(f)`],extract:[`.fold(onErr, onOk)`,`.match({Ok, Err})`,`.orElse(v)`,`.orThrow()`,`.toEither()`,`.toOption()`,`.toJSON()`],other:[`Task.cancellable(fn)`,`Task.withProgress(fn, onProgress)`,`Task.race(tasks, timeout?)`,`Task.getErrorChain(error)`,`Task.formatErrorChain(error)`]}},TaskOutcome:{description:`Result of a Task execution — Ok<T> or Err<T>. Implements Functor, AsyncMonad, Foldable, Extractable, Serializable. Construct via Ok(v) / Err(e) or as the resolved value of Task(...).Sync() / Task(...).Async().`,interfaces:[`AsyncMonad`,`Extractable`,`Foldable`,`Functor`,`Serializable`],methods:{create:[`Ok(value)`,`Err(error)`,`Task.ok(value)`,`Task.err(error)`],transform:[`.map(f)`,`.flatMap(f)`,`.mapError(f)`,`.recover(v)`,`.recoverWith(f)`,`.mapAsync(f)`,`.flatMapAsync(f)`],extract:[`.fold(onErr, onOk)`,`.match({Ok, Err})`,`.orElse(v)`,`.orThrow()`,`.toEither()`,`.toOption()`,`.toJSON()`],check:[`.isOk()`,`.isErr()`,`.isSuccess()`,`.isFailure()`]}},TaskResult:{description:"Type alias for `Promise<TaskOutcome<T>>`. Returned by Task(params).Async(...) and adapter functions like Fs.readFile, Process.exec. Await it to get the inner TaskOutcome; chain Promise methods on the outside, TaskOutcome methods after the await.",interfaces:[],methods:{create:[`Task(params).Async(fn, errFn) → TaskResult<T>`,`Task.fromPromise(fn) → (...args) => TaskResult<U>`],other:[`await taskResult → TaskOutcome<T>`,`// then use any TaskOutcome method (.fold, .map, .toEither, ...)`]}},Exit:{description:`Outcome of running an IO effect — Success | Failure | Die | Interrupted, returned by .runExit(). Die carries a defect: a value that is not an E. Either has no branch for one, so .run() cannot show it.`,interfaces:[],methods:{create:[`Exit.succeed(v)`,`Exit.fail(e)`,`Exit.die(defect)`,`Exit.interrupt(fiberId)`,`Exit.interrupted()`],transform:[`.map(f)`,`.mapError(f)`,`.mapBoth(onErr, onOk)`,`.flatMap(f)`],extract:[`.fold(onFailure, onSuccess, onInterrupted?, onDie?)`,`.match({Success, Failure, Interrupted, Die?})`,`.orThrow()`,`.orElse(v)`,`.toOption()`,`.toEither()`,`.toValue()`],check:[`.isSuccess()`,`.isFailure()`,`.isDie()`,`.isInterrupted()`],other:[`Exit.zip(a, b)`,`Exit.all(exits)`,`Exit.fromEither(e)`,`Exit.fromOption(o, onNone)`,`// onDie / Die are optional and fall back to the failure handler`,`// defects stay recoverable: .recover/.recoverWith/.fold/.mapError treat Die as Failure`]}},IO:{description:`Lazy effect type with typed errors and dependency injection`,interfaces:[`Functor`,`Monad`,`Foldable`,`Matchable`],methods:{create:[`IO(() => v)`,`IO.succeed(v)`,`IO.fail(e)`,`IO.sync(f)`,`IO.async(f)`,`IO.tryPromise({try, catch})`,`IO.fromEither(e)`,`IO.fromOption(o)`,`IO.fromTry(t)`,`IO.die(defect)`],transform:[`.map(f)`,`.flatMap(f)`,`.tap(f)`,`.mapError(f)`,`.recover(v)`,`.recoverWith(f)`],extract:[`.run() // Either<E,A> — a defect or interruption arrives in the Left, raw`,`.runOrThrow()`,`.runSync()`,`.runSyncOrThrow()`,`.runExit() // Exit<E,A> — the only terminal that distinguishes Failure/Die/Interrupted`,`.runOption()`,`.runTry()`,`.fold(onErr, onOk)`,`.match({failure, success})`],check:[],other:[`.catchTag(tag, f)`,`.catchAll(f)`,`.retry(n)`,`.retryWithDelay(n, ms)`,`.retryWhile({ n, while, delayMs? })`,`.retryWithBackoff({ n, baseMs, maxMs?, factor?, jitter?, while? })`,`.repeatUntil(done, { max, delayMs? })`,`.repeatWhile(cont, { max, delayMs? })`,`.timeout(ms)`,`.delay(ms)`,`.zip(io)`,`.pipe(f)`,`IO.all([...])`,`IO.race([...])`,`IO.iterate(seed, step, done, { max? })`,`IO.bracket(acquire, use, release)`,`IO.gen(function*() {...})`,`IO.Do.bind().map()`,`IO.service(Tag)`,`.provideService(Tag, impl)`,`.provideLayer(layer)`]}},Cond:{description:`Conditional expression builder - replace if-else chains`,interfaces:[],methods:{create:[`Cond<T>()`],other:[`.case(pred, result)`,`.otherwise(result)`,`.eval()`]}},Match:{description:`Pattern matching - replace switch statements`,interfaces:[],methods:{create:[`Match(value)`],other:[`.case(pattern, result)`,`.when(pred, result)`,`.default(result)`,`.done()`]}},Brand:{description:`Nominal typing without runtime overhead`,interfaces:[],methods:{create:[`Brand<K, T>(value)`],extract:[`.unwrap()`,`.toString()`]}},Wire:{description:"Serialization-boundary marker for collections crossing DB / HTTP / JSONB boundaries. Zero runtime, structurally identical to ReadonlyArray<T> (bidirectionally assignable, no casts). Value comes from grep-ability (`rg 'Wire<'`), documented intent at the declaration site, and pairing with `functype/prefer-list` set to `allowReadonlyArrays: false` — Wire<T> is the sole explicit boundary escape hatch.",interfaces:[],methods:{create:[`type Row = Wire<{ id: string }>`],other:[`List(rows).filter(...) // convert to List for transformation`]}},ValidatedBrand:{description:`Branded types with runtime validation`,interfaces:[],methods:{create:[`ValidatedBrand(validator)`,`.of(v)`,`.from(v)`,`.unsafeOf(v)`],check:[`.is(v)`],other:[`.refine(validator)`]}},Tuple:{description:`Fixed-size typed array`,interfaces:r(`Tuple`,`Typeable`,`Valuable`,`Iterable`),methods:{create:[`Tuple([a, b, ...])`,`Tuple.of(a, b, ...)`,`Tuple.fromJSON(json)`],extract:[`.first`,`.second`,`.toArray()`,`.toJSON()`],transform:[`.map(f)`]}},Stack:{description:`Immutable LIFO stack`,interfaces:[`Foldable`,`Collection`,`Serializable`,`Traversable`],methods:{create:[`Stack()`,`Stack.of(...)`],transform:[`.push(v)`,`.pop()`],extract:[`.peek()`,`.toArray()`],check:[`.isEmpty`,`.size`]}},Http:{description:"HTTP fetch wrapper returning IO<never, HttpError, HttpResponse<T>>. Pass `decode: Decoder<T>` (Either-returning) for typed responses; the deprecated `validate: (data) => T` field is still accepted for throw-pattern back-compat. Request bodies auto-flatten functype ADTs to primitives; `flatten: false` preserves tagged emission for functype-to-functype services. Per-call `params` (HttpQueryParams) appends query strings with proper encoding. Http.client accepts `beforeRequest` and `afterResponse` (both effectful IO transformers). `afterResponse` runs on the success path only — error handling belongs in .catchTag. Composes via .tap/.map/.flatMap/.catchTag/.retry/.retryWhile/.retryWithBackoff/.timeout.",interfaces:[],methods:{create:[`Http.get(url, { decode, params }?)`,`Http.post(url, { body, decode, params }?)`,`Http.put(url, { body, decode, params }?)`,`Http.patch(url, { body, decode, params }?)`,`Http.delete(url, { decode, params }?)`,`Http.request({ url, decode, params })`,`Http.client({ baseUrl, defaultHeaders, fetch, beforeRequest, afterResponse })`],transform:[`.tap(f)`,`.map(f)`,`.flatMap(f)`,`.mapError(f)`,`.retry(n)`,`.retryWithDelay(n, ms)`,`.retryWhile({ n, while, delayMs? })`,`.retryWithBackoff({ n, baseMs, maxMs?, factor?, jitter?, while? })`,`.timeout(ms)`],extract:[`.run()`,`.runOrThrow()`,`.runOption()`,`.runTry()`,`.runExit()`],check:[],other:[`.catchTag(tag, handler)`,`.catchAll(handler)`,`.recover(fallback)`,`decode: Decoder<T> (Either-returning, structural failures preserved)`,`validate: (data) => T (deprecated, throws — for back-compat / Zod .parse)`,`flatten: boolean (default true; false preserves tagged emission)`,`params: HttpQueryParams (scalar | array; undefined/null dropped; percent-encoded)`,`beforeRequest: (req) => IO<never, HttpError, HttpRequestView>`,`afterResponse: (HttpResponse<unknown>) => IO<never, HttpError, HttpResponse<unknown>> — success path only; refresh-on-401 uses .catchTag`]}},HttpError:{description:`Three-variant ADT for HTTP failures: NetworkError | HttpStatusError | DecodeError (also exported as ResponseDecodeError alias)`,interfaces:[],methods:{create:[`HttpError.networkError(url, method, cause)`,`HttpError.httpStatusError(url, method, status, statusText, body)`,`HttpError.decodeError(url, method, body, cause)`],check:[`HttpError.isNetworkError(e)`,`HttpError.isHttpStatusError(e)`,`HttpError.isDecodeError(e)`],other:[`HttpError.match(error, { NetworkError, HttpStatusError, DecodeError })`]}},Decoder:{description:"Either-returning decoder contract: `Decoder<A> = (raw: unknown) => Either<DecoderError, A>`. Bundled combinators for primitives + functype ADTs (Option/Either/List/Map, null-bias). `Decoder.tagged.*` round-trips the `{_tag, value}` shape for functype-to-functype services.",interfaces:[],methods:{create:[`Decoder.string / .number / .boolean / .unknown / .nullable(inner)`,`Decoder.option(inner)`,`Decoder.either.envelope({ok, err})`,`Decoder.either.discriminated({tag, leftTag, rightTag}, l, r)`,`Decoder.list(inner) / .array(inner) / .map(inner)`,`Decoder.object({k: Decoder<V>, ...}) — accumulates field failures into Composite`,`Decoder.tagged.option/either/try/list/map/obj(inner?) — round-trips {_tag, value}`],other:[`Pluggable by construction: any (raw) => Either<DecoderError, T> IS a Decoder<T>`,`Composes across sources: Decoder.object({a: Decoder.fromZod(s), b: Decoder.option(myAjv)})`]}},DecoderError:{description:"Recursive ADT for decoder failures: Leaf | Composite. Children mirror the input tree so multi-field failures preserve structural paths. Distinct from `HttpError.DecodeError` — this is the inner structural cause that the HTTP wrapper carries.",interfaces:[],methods:{create:[`DecoderError.leaf(path, message, cause?)`,`DecoderError.composite(path, children: List<DecoderError>)`],check:[`DecoderError.isLeaf(e)`,`DecoderError.isComposite(e)`],other:[`DecoderError.match(e, { Leaf, Composite })`,`DecoderError.prepend(segment, e) — used by combinators to attribute child failures`,`DecoderError.flatten(e): List<{path, message}> — collect leaves`,`DecoderError.format(e): string — render tree as multi-line`]}},Serialization:{description:"Universal `@functype`-marked JSON serialization. `deserialize` walks parsed JSON and reconstructs any functype value found — no type argument needed. Lenient: plain JSON passes through. Strict on unknown markers (defends against Effect/fp-ts `_tag` collision). 1.2.1 adds `toEnvelope`/`fromEnvelope` for nesting inside structured serializers (SuperJSON, DBOS), and `deserializeStrict` for boundaries that require functype on the wire.",interfaces:[],methods:{create:[],transform:[`Serialization.serialize(value: unknown): string — lenient JSON codec`,`Serialization.deserialize(json: string): Try<unknown> — lenient; pass-through for unmarked JSON`,`Serialization.deserializeStrict(json: string): Try<unknown> — Failure if no @functype marker at top level`,`Serialization.toEnvelope(value: unknown): JSONValue — parsed JSON shape (1.2.2 tightened from unknown)`,`Serialization.fromEnvelope(envelope: unknown): Try<unknown> — inverse of toEnvelope; input stays permissive (Postel's law)`,`Serialization.JSONValue — exported recursive type for the envelope shape`],check:[`Serialization.isFunctypeValue(v): v is Serializable<unknown>`],other:[`Plain JSON passthrough: non-functype data walks through unchanged (use deserializeStrict to reject)`,`Strict policy on unknown markers: unknown @functype marker → Try.Failure`,`Dispatch table covers all 12 Serializable types (Option, Either, Try, List, Set, Map, Obj, Stack, Tuple, LazyList, Lazy, Task)`,`Algebraic square: serialize ≡ JSON.stringify ∘ toEnvelope; deserialize ≡ fromEnvelope ∘ JSON.parse`,`No DBOS / SuperJSON facade — consumers wire host serializer in ~8 lines via toEnvelope/fromEnvelope`]}},SerializedError:{description:"Canonical Error projection used by Try.Failure, Task.Err, Lazy-with-thrown-thunk. Round-trips name + message + stack + cause chain. `e.name === 'TypeError'` survives; `instanceof TypeError` does NOT.",interfaces:[],methods:{create:[`serializeError(err: unknown): SerializedError`,`deserializeError(s: SerializedError | string): Error`],other:[`Shape: { name: string; message: string; stack?: string; cause?: SerializedError | string }`,`Non-Error throwables (strings, plain objects) projected under name: 'NonErrorThrowable'`,`Cause chain is recursive — arbitrary nesting depth survives`]}},Logger:{description:'Minimal 4-method ecosystem-wide logging interface (1.3.0+). Type-only — no runtime, no `console` dependency, no opinion on output format. Every functype-* package targets this shape. Reachable from the top barrel (`import type { Logger } from "functype"`) and the `functype/logger` subpath. Concrete impls live in consumer packages: `consoleBootLogger` in `functype-os/config`, `DirectLogger` from `functype-log/direct` (structurally satisfies Logger — no adapter). Clock/Random/Tracer NOT being added — those are framework abstractions; Logger is uniquely justified because every production TS app already has one.',interfaces:[],methods:{create:[`interface Logger { debug, info, warn, error: (msg, meta?) => void }`,`import type { Logger } from "functype"`],check:[],other:[`All 4 methods MANDATORY (no defensive logger.debug?.() at call sites)`,`Signature: (message: string, metadata?: Record<string, unknown>) => void`,`DirectLogger from functype-log/direct structurally satisfies Logger (superset shape)`,`IO-shaped Logger from functype-log does NOT satisfy core Logger (methods return IO<>, not void) — bridge via toDirectLogger(ioLogger)`,`Used by: bootDiagnostics({ logger? }) in functype-os/config`]}},TypedError:{description:`Code-tagged structured error ADT (extends Throwable); TypedError.validation(...) feeds accumulating validation.`,interfaces:[],methods:{create:[`TypedError.validation(field, value, rule) → TypedError<"VALIDATION_FAILED">`,`TypedError.badRequest(reason, expected?)`,`TypedError.notFound(resource, id)`,`TypedError.auth(resource, requiredRole?)`,`TypedError.permission(action, resource, userId?)`,`TypedError.conflict(resource, value) / .rateLimit(limit, window, retryAfter?)`,`TypedError.timeout(ms, operation) / .network(url, method, status?) / .internal(errorId)`],check:[`TypedError.isTypedError(v)`,`TypedError.hasCode(e, code)`],other:[`Fields: .code, .message, .status (HTTP), .context, .timestamp, .traceId?`,`VALIDATION_FAILED context shape: { field, value, rule }`]}},Validation:{description:`Error-accumulating validation (functype's Validated role) — FormValidation<T> collects all field errors, not fail-fast.`,interfaces:[],methods:{create:[`Validation.rule<T>('min:18' | 'email' | 'required' | 'in:a,b' | ...)`,`Validation.combine(...validators) / Validation.custom(predicate, message)`,`Validation.validators.email / .url / .uuid / .required / .numeric / .positiveNumber / .nonEmptyString`],transform:[`Validation.form(schema, data) → FormValidation<T> (accumulates all field errors)`,`Validator<T> = (value: unknown) => Either<TypedError<'VALIDATION_FAILED'>, T>`],other:[`FormValidation<T> = Either<List<TypedError<"VALIDATION_FAILED">>, T> — functype's "Validated" accumulating result type`,`form() is flat/per-field: for cross-field (lo < hi) or dynamic-key (weights.*) checks, hand-accumulate into a List<TypedError> and return the FormValidation shape`]}}},a={Functor:{description:`Transform contained values`,methods:[`.map<B>(f: A => B): Functor<B>`]},Applicative:{extends:`Functor`,description:`Apply wrapped functions`,methods:[`.ap<B>(ff: Applicative<A => B>): Applicative<B>`]},Monad:{extends:`Applicative`,description:`Chain operations returning wrapped values`,methods:[`.flatMap<B>(f: A => Monad<B>): Monad<B>`]},Foldable:{description:`Extract via pattern matching`,methods:[`.fold<B>(empty: () => B, f: A => B): B`,`.foldLeft<B>(z: B, op: (B, A) => B): B`,`.foldRight<B>(z: B, op: (A, B) => B): B`]},Extractable:{description:`Get contained value with fallback`,methods:[`.orElse(d: T): T`,`.orThrow(e?: Error): T`,`.expect(handler: (e?) => never): T`,`.orNull(): T | null`,`.orUndefined(): T | undefined`]},Matchable:{description:`Pattern match on type variants`,methods:[`.match<R>(patterns: Record<Tag, Handler>): R`]},Traversable:{description:`Iterate and check contents`,methods:[`.size: number`,`.isEmpty: boolean`,`.contains(v: A): boolean`,`.reduce<B>(f, init): B`]},Collection:{description:`Collection operations`,methods:[`.toArray(): A[]`,`.forEach(f: A => void): void`]},Serializable:{description:`Convert to string formats`,methods:[`.serialize().toJSON(): string`,`.serialize().toYAML(): string`]}},o={Core:[`Option`,`Either`,`Try`,`Obj`],Collection:[`List`,`Set`,`Map`,`LazyList`,`Tuple`,`Stack`],Effect:[`IO`,`Exit`,`Task`,`TaskOutcome`,`TaskResult`,`Http`,`HttpError`,`Decoder`,`DecoderError`],Utility:[`Lazy`,`Cond`,`Match`,`Brand`,`ValidatedBrand`,`Wire`],Validation:[`TypedError`,`Validation`],Serialization:[`Serialization`,`SerializedError`],Service:[`Logger`]},s={Option:`export interface Option<out T extends Type>
|
|
1
|
+
var e=`1.10.0`;const t={Option:[`Applicative`,`AsyncMonad`,`Doable`,`Extractable`,`Foldable`,`Functor`,`Matchable`,`Monad`,`Promisable`,`Reshapeable`,`Serializable`,`Traversable`],Either:[`Applicative`,`AsyncMonad`,`Doable`,`Extractable`,`Foldable`,`Functor`,`Monad`,`Promisable`,`Reshapeable`,`Serializable`],Try:[`Applicative`,`AsyncMonad`,`Doable`,`Extractable`,`Foldable`,`Functor`,`Monad`,`Promisable`,`Reshapeable`,`Serializable`],List:[`Collection`,`Doable`,`Iterable`,`Reshapeable`],Set:[`Collection`,`Iterable`],Map:[`Collection`,`Foldable`,`Iterable`,`KVTraversable`,`Serializable`],Obj:[`Doable`,`Promisable`,`Reshapeable`],Lazy:[`Applicative`,`AsyncMonad`,`Extractable`,`Foldable`,`Functor`,`Monad`,`Serializable`,`Traversable`],LazyList:[`Foldable`,`Serializable`],Tuple:[`Foldable`,`Serializable`],Task:[`Applicative`,`AsyncMonad`,`Doable`,`Extractable`,`Foldable`,`Functor`,`Monad`,`Promisable`,`Serializable`,`Traversable`]},n=e,r=(e,...n)=>Array.from(/* @__PURE__ */ new Set([...t[e],...n])).sort(),i={Option:{description:`Safe nullable handling - Some<T> or None`,interfaces:r(`Option`),methods:{create:[`Option(v)`,`Option.none()`,`Some(v)`,`None()`],transform:[`.map(f)`,`.flatMap(f)`,`.filter(p)`,`.ap(ff)`],extract:[`.fold(n, s)`,`.foldAsync(n, s)`,`.orElse(d)`,`.orThrow()`,`.expect(() => never)`,`.orNull()`,`.match({Some, None})`,`.toEither(left | () => left)`,`.toList()`,`.toArray()`],check:[`.isSome()`,`.isNone()`,`.isEmpty`],other:[`Option.sequence(arr)`,`Option.traverse(arr, f)`]}},Either:{description:`Error handling with Left (error) or Right (success)`,interfaces:r(`Either`,`Traversable`),methods:{create:[`Right(v)`,`Left(e)`,`Either.right(v)`,`Either.left(e)`,`Either.void()`],transform:[`.map(f)`,`.flatMap(f)`,`.mapLeft(f)`,`.swap()`],extract:[`.fold(l, r)`,`.foldAsync(l, r)`,`.orElse(d)`,`.orThrow()`,`.expect((l) => never)`,`.match({Left, Right})`],check:[`.isRight()`,`.isLeft()`],other:[`Either.sequence(arr)`,`Either.traverse(arr, f)`,`Either.fromNullable(v, e)`]}},Try:{description:`Wrap operations that may throw - Success<T> or Failure`,interfaces:r(`Try`,`Matchable`,`Traversable`),methods:{create:[`Try(() => expr)`,`Try.success(v)`,`Try.failure(e)`,`Try.fromPromise(p)`,`Try.async(() => Promise<T>)`],transform:[`.map(f)`,`.flatMap(f)`,`.recover(f)`,`.recoverWith(f)`],extract:[`.fold(f, s)`,`.foldAsync(f, s)`,`.orElse(d)`,`.orThrow()`,`.expect((e) => never)`,`.toOption()`,`.toEither(left | (err) => left)`,`.toList()`,`.toArray()`],check:[`.isSuccess()`,`.isFailure()`],other:[`Try.sequence(arr)`,`Try.traverse(arr, f)`]}},List:{description:`Immutable array with functional operations`,interfaces:r(`List`,`Functor`,`Monad`,`Foldable`,`Serializable`,`Traversable`),methods:{create:[`List([...])`,`List.of(...)`,`List.empty()`],transform:[`.map(f)`,`.flatMap(f)`,`.filter(p)`,`.take(n)`,`.takeWhile(p)`,`.takeRight(n)`,`.drop(n)`,`.dropWhile(p)`,`.concat(list)`,`.reverse()`,`.distinct()`,`.sorted()`,`.sortBy(f)`,`.zip(list)`,`.zipWithIndex()`,`.prepend(v)`,`.slice(s, e)`],extract:[`.fold(z, f)`,`.reduce(f)`,`.head`,`.headOption`,`.tail`,`.last`,`.lastOption`,`.init`,`.indexOf(v)`,`.toArray()`],check:[`.isEmpty`,`.nonEmpty`,`.size`,`.contains(v)`],other:[`.groupBy(f)`,`.partition(p)`,`.span(p)`]}},Set:{description:`Immutable set of unique values`,interfaces:r(`Set`,`Functor`,`Foldable`,`Serializable`,`Traversable`),methods:{create:[`Set([...])`,`Set.of(...)`,`Set.empty()`],transform:[`.map(f)`,`.filter(p)`,`.union(s)`,`.intersection(s)`,`.difference(s)`,`.add(v)`],extract:[`.fold(z, f)`,`.toArray()`],check:[`.has(v)`,`.isEmpty`,`.size`]}},Obj:{description:`Immutable object wrapper with fluent operations`,interfaces:r(`Obj`,`KVTraversable`,`Foldable`,`Matchable`,`Extractable`,`Serializable`),methods:{create:[`Obj({...})`,`Obj.of({...})`,`Obj.empty()`],transform:[`.set(k, v)`,`.assign(partial)`,`.merge(obj)`,`.when(cond, partial)`,`.omit(...keys)`,`.pick(...keys)`,`.map(f)`,`.flatMap(f)`],extract:[`.get(k)`,`.value()`,`.keys()`,`.values()`,`.entries()`,`.fold(n, s)`,`.match({Obj})`],check:[`.has(k)`,`.isEmpty`,`.size`]}},Map:{description:`Immutable key-value store`,interfaces:r(`Map`),methods:{create:[`Map([[k, v], ...])`,`Map.of([k, v], ...)`,`Map.empty()`],transform:[`.set(k, v)`,`.delete(k)`,`.map(f)`,`.filter(p)`,`.add(k, v)`],extract:[`.get(k)`,`.keys()`,`.values()`,`.entries()`,`.fold(z, f)`],check:[`.has(k)`,`.isEmpty`,`.size`]}},Lazy:{description:"Deferred computation with memoization. Note: `serialize()` and `toValue()` FORCE the thunk (visible side effect) since a closure cannot be JSON-serialized — there is no representable 'unevaluated post-serialize' state. Thunk failures are captured via SerializedError and rethrown on access after fromJSON.",interfaces:r(`Lazy`),methods:{create:[`Lazy(() => expr)`,`Lazy.fromValue(value) — wrap a non-deferred value`,`Lazy.evaluated(value) — reads as 'already-forced'; used by fromJSON`,`Lazy.fail(error) — Lazy that throws on access`],transform:[`.map(f)`,`.flatMap(f)`],extract:[`.fold(n, s)`,`.orElse(d)`,`.orThrow()`,`.get()`,`.toJSON()`,`Lazy.fromJSON(json)`],check:[`.isEvaluated`]}},LazyList:{description:`Lazy sequences for large/infinite data`,interfaces:r(`LazyList`,`Functor`,`Monad`,`Iterable`),methods:{create:[`LazyList.from(iter)`,`LazyList.range(start, end)`,`LazyList.infinite(f)`,`LazyList.fromJSON(json)`],transform:[`.map(f)`,`.filter(p)`,`.take(n)`,`.takeRight(n)`,`.drop(n)`,`.takeWhile(p)`,`.dropWhile(p)`,`.concat(ll)`,`.reverse()`,`.distinct()`,`.zip(ll)`,`.zipWithIndex()`],extract:[`.head`,`.headOption`,`.tail`,`.last`,`.lastOption`,`.init`,`.toArray()`,`.toJSON()`],check:[`.isEmpty`]}},Task:{description:`Async operations with cancellation and progress tracking. Returns TaskOutcome<T> (Ok/Err) which implements Functor, AsyncMonad, Foldable, Extractable, Serializable`,interfaces:r(`Task`),methods:{create:[`Task(params).Async(fn, errFn)`,`Task(params).Sync(fn, errFn)`,`Task.ok(value)`,`Task.err(error)`,`Task.fromEither(either)`,`Task.fromTry(try)`,`Task.fromPromise(fn)`,`Task.fromNodeCallback(fn)`,`Task.fromJSON(json) — reconstruct from serialize() output`],transform:[`.map(f)`,`.flatMap(f)`,`.mapError(f)`,`.recover(v)`,`.recoverWith(f)`],extract:[`.fold(onErr, onOk)`,`.match({Ok, Err})`,`.orElse(v)`,`.orThrow()`,`.toEither()`,`.toOption()`,`.toJSON()`],other:[`Task.cancellable(fn)`,`Task.withProgress(fn, onProgress)`,`Task.race(tasks, timeout?)`,`Task.getErrorChain(error)`,`Task.formatErrorChain(error)`]}},TaskOutcome:{description:`Result of a Task execution — Ok<T> or Err<T>. Implements Functor, AsyncMonad, Foldable, Extractable, Serializable. Construct via Ok(v) / Err(e) or as the resolved value of Task(...).Sync() / Task(...).Async().`,interfaces:[`AsyncMonad`,`Extractable`,`Foldable`,`Functor`,`Serializable`],methods:{create:[`Ok(value)`,`Err(error)`,`Task.ok(value)`,`Task.err(error)`],transform:[`.map(f)`,`.flatMap(f)`,`.mapError(f)`,`.recover(v)`,`.recoverWith(f)`,`.mapAsync(f)`,`.flatMapAsync(f)`],extract:[`.fold(onErr, onOk)`,`.match({Ok, Err})`,`.orElse(v)`,`.orThrow()`,`.toEither()`,`.toOption()`,`.toJSON()`],check:[`.isOk()`,`.isErr()`,`.isSuccess()`,`.isFailure()`]}},TaskResult:{description:"Type alias for `Promise<TaskOutcome<T>>`. Returned by Task(params).Async(...) and adapter functions like Fs.readFile, Process.exec. Await it to get the inner TaskOutcome; chain Promise methods on the outside, TaskOutcome methods after the await.",interfaces:[],methods:{create:[`Task(params).Async(fn, errFn) → TaskResult<T>`,`Task.fromPromise(fn) → (...args) => TaskResult<U>`],other:[`await taskResult → TaskOutcome<T>`,`// then use any TaskOutcome method (.fold, .map, .toEither, ...)`]}},Exit:{description:`Outcome of running an IO effect — Success | Failure | Die | Interrupted, returned by .runExit(). Die carries a defect: a value that is not an E. Either has no branch for one, so .run() cannot show it.`,interfaces:[],methods:{create:[`Exit.succeed(v)`,`Exit.fail(e)`,`Exit.die(defect)`,`Exit.interrupt(fiberId)`,`Exit.interrupted()`],transform:[`.map(f)`,`.mapError(f)`,`.mapBoth(onErr, onOk)`,`.flatMap(f)`],extract:[`.fold(onFailure, onSuccess, onInterrupted?, onDie?)`,`.match({Success, Failure, Interrupted, Die?})`,`.orThrow()`,`.orElse(v)`,`.toOption()`,`.toEither()`,`.toValue()`],check:[`.isSuccess()`,`.isFailure()`,`.isDie()`,`.isInterrupted()`],other:[`Exit.zip(a, b)`,`Exit.all(exits)`,`Exit.fromEither(e)`,`Exit.fromOption(o, onNone)`,`// onDie / Die are optional and fall back to the failure handler`,`// defects stay recoverable: .recover/.recoverWith/.fold/.mapError treat Die as Failure`]}},IO:{description:`Lazy effect type with typed errors and dependency injection`,interfaces:[`Functor`,`Monad`,`Foldable`,`Matchable`],methods:{create:[`IO(() => v)`,`IO.succeed(v)`,`IO.fail(e)`,`IO.sync(f)`,`IO.async(f)`,`IO.tryPromise({try, catch})`,`IO.fromEither(e)`,`IO.fromOption(o)`,`IO.fromTry(t)`,`IO.die(defect)`],transform:[`.map(f)`,`.flatMap(f)`,`.tap(f)`,`.mapError(f)`,`.recover(v)`,`.recoverWith(f)`],extract:[`.run() // Either<E,A> — a defect or interruption arrives in the Left, raw`,`.runOrThrow()`,`.runSync()`,`.runSyncOrThrow()`,`.runExit() // Exit<E,A> — the only terminal that distinguishes Failure/Die/Interrupted`,`.runOption()`,`.runTry()`,`.fold(onErr, onOk)`,`.match({failure, success})`],check:[],other:[`.catchTag(tag, f)`,`.catchAll(f)`,`.retry(n)`,`.retryWithDelay(n, ms)`,`.retryWhile({ n, while, delayMs? })`,`.retryWithBackoff({ n, baseMs, maxMs?, factor?, jitter?, while? })`,`.repeatUntil(done, { max, delayMs? })`,`.repeatWhile(cont, { max, delayMs? })`,`.timeout(ms)`,`.delay(ms)`,`.zip(io)`,`.pipe(f)`,`IO.all([...])`,`IO.race([...])`,`IO.iterate(seed, step, done, { max? })`,`IO.bracket(acquire, use, release)`,`IO.gen(function*() {...})`,`IO.Do.bind().map()`,`IO.service(Tag)`,`.provideService(Tag, impl)`,`.provideLayer(layer)`]}},Cond:{description:`Conditional expression builder - replace if-else chains`,interfaces:[],methods:{create:[`Cond<T>()`],other:[`.case(pred, result)`,`.otherwise(result)`,`.eval()`]}},Match:{description:`Pattern matching - replace switch statements`,interfaces:[],methods:{create:[`Match(value)`],other:[`.case(pattern, result)`,`.when(pred, result)`,`.default(result)`,`.done()`]}},Brand:{description:`Nominal typing without runtime overhead`,interfaces:[],methods:{create:[`Brand<K, T>(value)`],extract:[`.unwrap()`,`.toString()`]}},Wire:{description:`Serialization-boundary marker for a row, collection or nullable field at DB / HTTP / JSONB boundaries. Zero runtime, assignable both ways with T. prefer-list and prefer-option skip everything inside it. A collection is Wire<ReadonlyArray<Row>>.`,interfaces:[],methods:{create:[`type UserRow = Wire<{ email: string | null }>`,`type Rows = Wire<ReadonlyArray<Row>>`,`email: Wire<string | null>`],other:[`List(rows).filter(...) // convert to List for transformation`,`Option(row.email) // convert to Option`]}},ValidatedBrand:{description:`Branded types with runtime validation`,interfaces:[],methods:{create:[`ValidatedBrand(validator)`,`.of(v)`,`.from(v)`,`.unsafeOf(v)`],check:[`.is(v)`],other:[`.refine(validator)`]}},Tuple:{description:`Fixed-size typed array`,interfaces:r(`Tuple`,`Typeable`,`Valuable`,`Iterable`),methods:{create:[`Tuple([a, b, ...])`,`Tuple.of(a, b, ...)`,`Tuple.fromJSON(json)`],extract:[`.first`,`.second`,`.toArray()`,`.toJSON()`],transform:[`.map(f)`]}},Identity:{description:`The identity monad: wraps a value with no extra effect. Useful as a neutral container in generic code.`,interfaces:[],methods:{create:[`Identity(value)`,`Identity.of(value)`,`Identity.pure(value)`],extract:[`.id`],other:[`.isSame(other)`]}},Ref:{description:`Mutable reference cell for controlled, local mutability. Invariant in A by design (a mutable cell can't be widened).`,interfaces:[],methods:{create:[`Ref(initial)`,`Ref.of(initial)`],extract:[`.get()`],transform:[`.set(a)`,`.update(f)`,`.modify(f) // returns B, stores A`],other:[`.getAndSet(a)`,`.updateAndGet(f)`,`.getAndUpdate(f)`,`.compareAndSet(expected, next)`]}},Do:{description:`Generator do-notation across Option, Either, List and Try (DoAsync for promises). Short-circuits on None/Left/Failure/empty List.`,interfaces:[],methods:{create:[`Do(function* () { const a = yield* $(opt); return a })`,`DoAsync(async function* () { … })`],other:[`$(monad) // unwrap inside Do`,`isDoCapable(value)`,`unwrap(monad)`]}},TracedOption:{description:`Opt-in Option wrapper that emits one TraceEvent per combinator to an injected Tracer, then delegates. For code-path introspection.`,interfaces:[],methods:{create:[`TracedOption(option, tracer, spanId, seq?)`],transform:[`.map(f, label?)`,`.flatMap(f, label?)`,`.filter(p, label?)`],extract:[`.fold(onNone, onSome, label?)`,`.orElse(default, label?)`,`.unwrap() // back to Option`]}},Tracer:{description:`One-method trace sink consumed by TracedOption. Type-only, like Logger; declare your own Tag for injection.`,interfaces:[],methods:{create:[`const tracer: Tracer = { emit: (e: TraceEvent) => … }`],other:[`TraceEvent: { spanId, seq, op, tag, inTag, outTag?, label?, meta? }`]}},Stack:{description:`Immutable LIFO stack`,interfaces:[`Foldable`,`Collection`,`Serializable`,`Traversable`],methods:{create:[`Stack()`,`Stack.of(...)`],transform:[`.push(v)`,`.pop()`],extract:[`.peek()`,`.toArray()`],check:[`.isEmpty`,`.size`]}},Http:{description:"HTTP fetch wrapper returning IO<never, HttpError, HttpResponse<T>>. Pass `decode: Decoder<T>` (Either-returning) for typed responses; the deprecated `validate: (data) => T` field is still accepted for throw-pattern back-compat. Request bodies auto-flatten functype ADTs to primitives; `flatten: false` preserves tagged emission for functype-to-functype services. Per-call `params` (HttpQueryParams) appends query strings with proper encoding. Http.client accepts `beforeRequest` and `afterResponse` (both effectful IO transformers). `afterResponse` runs on the success path only — error handling belongs in .catchTag. Composes via .tap/.map/.flatMap/.catchTag/.retry/.retryWhile/.retryWithBackoff/.timeout.",interfaces:[],methods:{create:[`Http.get(url, { decode, params }?)`,`Http.post(url, { body, decode, params }?)`,`Http.put(url, { body, decode, params }?)`,`Http.patch(url, { body, decode, params }?)`,`Http.delete(url, { decode, params }?)`,`Http.request({ url, decode, params })`,`Http.client({ baseUrl, defaultHeaders, fetch, beforeRequest, afterResponse })`],transform:[`.tap(f)`,`.map(f)`,`.flatMap(f)`,`.mapError(f)`,`.retry(n)`,`.retryWithDelay(n, ms)`,`.retryWhile({ n, while, delayMs? })`,`.retryWithBackoff({ n, baseMs, maxMs?, factor?, jitter?, while? })`,`.timeout(ms)`],extract:[`.run()`,`.runOrThrow()`,`.runOption()`,`.runTry()`,`.runExit()`],check:[],other:[`.catchTag(tag, handler)`,`.catchAll(handler)`,`.recover(fallback)`,`decode: Decoder<T> (Either-returning, structural failures preserved)`,`validate: (data) => T (deprecated, throws — for back-compat / Zod .parse)`,`flatten: boolean (default true; false preserves tagged emission)`,`params: HttpQueryParams (scalar | array; undefined/null dropped; percent-encoded)`,`beforeRequest: (req) => IO<never, HttpError, HttpRequestView>`,`afterResponse: (HttpResponse<unknown>) => IO<never, HttpError, HttpResponse<unknown>> — success path only; refresh-on-401 uses .catchTag`]}},HttpError:{description:`Three-variant ADT for HTTP failures: NetworkError | HttpStatusError | DecodeError (also exported as ResponseDecodeError alias)`,interfaces:[],methods:{create:[`HttpError.networkError(url, method, cause)`,`HttpError.httpStatusError(url, method, status, statusText, body)`,`HttpError.decodeError(url, method, body, cause)`],check:[`HttpError.isNetworkError(e)`,`HttpError.isHttpStatusError(e)`,`HttpError.isDecodeError(e)`],other:[`HttpError.match(error, { NetworkError, HttpStatusError, DecodeError })`]}},Decoder:{description:"Either-returning decoder contract: `Decoder<A> = (raw: unknown) => Either<DecoderError, A>`. Bundled combinators for primitives + functype ADTs (Option/Either/List/Map, null-bias). `Decoder.tagged.*` round-trips the `{_tag, value}` shape for functype-to-functype services.",interfaces:[],methods:{create:[`Decoder.string / .number / .boolean / .unknown / .nullable(inner)`,`Decoder.option(inner)`,`Decoder.either.envelope({ok, err})`,`Decoder.either.discriminated({tag, leftTag, rightTag}, l, r)`,`Decoder.list(inner) / .array(inner) / .map(inner)`,`Decoder.object({k: Decoder<V>, ...}) — accumulates field failures into Composite`,`Decoder.tagged.option/either/try/list/map/obj(inner?) — round-trips {_tag, value}`],other:[`Pluggable by construction: any (raw) => Either<DecoderError, T> IS a Decoder<T>`,`Composes across sources: Decoder.object({a: Decoder.fromZod(s), b: Decoder.option(myAjv)})`]}},DecoderError:{description:"Recursive ADT for decoder failures: Leaf | Composite. Children mirror the input tree so multi-field failures preserve structural paths. Distinct from `HttpError.DecodeError` — this is the inner structural cause that the HTTP wrapper carries.",interfaces:[],methods:{create:[`DecoderError.leaf(path, message, cause?)`,`DecoderError.composite(path, children: List<DecoderError>)`],check:[`DecoderError.isLeaf(e)`,`DecoderError.isComposite(e)`],other:[`DecoderError.match(e, { Leaf, Composite })`,`DecoderError.prepend(segment, e) — used by combinators to attribute child failures`,`DecoderError.flatten(e): List<{path, message}> — collect leaves`,`DecoderError.format(e): string — render tree as multi-line`]}},Serialization:{description:"Universal `@functype`-marked JSON serialization. `deserialize` walks parsed JSON and reconstructs any functype value found — no type argument needed. Lenient: plain JSON passes through. Strict on unknown markers (defends against Effect/fp-ts `_tag` collision). 1.2.1 adds `toEnvelope`/`fromEnvelope` for nesting inside structured serializers (SuperJSON, DBOS), and `deserializeStrict` for boundaries that require functype on the wire.",interfaces:[],methods:{create:[],transform:[`Serialization.serialize(value: unknown): string — lenient JSON codec`,`Serialization.deserialize(json: string): Try<unknown> — lenient; pass-through for unmarked JSON`,`Serialization.deserializeStrict(json: string): Try<unknown> — Failure if no @functype marker at top level`,`Serialization.toEnvelope(value: unknown): JSONValue — parsed JSON shape (1.2.2 tightened from unknown)`,`Serialization.fromEnvelope(envelope: unknown): Try<unknown> — inverse of toEnvelope; input stays permissive (Postel's law)`,`Serialization.JSONValue — exported recursive type for the envelope shape`],check:[`Serialization.isFunctypeValue(v): v is Serializable<unknown>`],other:[`Plain JSON passthrough: non-functype data walks through unchanged (use deserializeStrict to reject)`,`Strict policy on unknown markers: unknown @functype marker → Try.Failure`,`Dispatch table covers all 12 Serializable types (Option, Either, Try, List, Set, Map, Obj, Stack, Tuple, LazyList, Lazy, Task)`,`Algebraic square: serialize ≡ JSON.stringify ∘ toEnvelope; deserialize ≡ fromEnvelope ∘ JSON.parse`,`No DBOS / SuperJSON facade — consumers wire host serializer in ~8 lines via toEnvelope/fromEnvelope`]}},SerializedError:{description:"Canonical Error projection used by Try.Failure, Task.Err, Lazy-with-thrown-thunk. Round-trips name + message + stack + cause chain. `e.name === 'TypeError'` survives; `instanceof TypeError` does NOT.",interfaces:[],methods:{create:[`serializeError(err: unknown): SerializedError`,`deserializeError(s: SerializedError | string): Error`],other:[`Shape: { name: string; message: string; stack?: string; cause?: SerializedError | string }`,`Non-Error throwables (strings, plain objects) projected under name: 'NonErrorThrowable'`,`Cause chain is recursive — arbitrary nesting depth survives`]}},Logger:{description:`Minimal 4-method logging interface every functype-* package targets. Type-only, no runtime. Impls live in consumers: consoleBootLogger (functype-os/config), DirectLogger (functype-log/direct). Tracer is type-only on the same terms; Clock/Random are not added.`,interfaces:[],methods:{create:[`interface Logger { debug, info, warn, error: (msg, meta?) => void }`,`import type { Logger } from "functype"`],check:[],other:[`All 4 methods MANDATORY (no defensive logger.debug?.() at call sites)`,`Signature: (message: string, metadata?: Record<string, unknown>) => void`,`DirectLogger from functype-log/direct structurally satisfies Logger (superset shape)`,`IO-shaped Logger from functype-log does NOT satisfy core Logger (methods return IO<>, not void) — bridge via toDirectLogger(ioLogger)`,`Used by: bootDiagnostics({ logger? }) in functype-os/config`]}},TypedError:{description:`Code-tagged structured error ADT (extends Throwable); TypedError.validation(...) feeds accumulating validation.`,interfaces:[],methods:{create:[`TypedError.validation(field, value, rule) → TypedError<"VALIDATION_FAILED">`,`TypedError.badRequest(reason, expected?)`,`TypedError.notFound(resource, id)`,`TypedError.auth(resource, requiredRole?)`,`TypedError.permission(action, resource, userId?)`,`TypedError.conflict(resource, value) / .rateLimit(limit, window, retryAfter?)`,`TypedError.timeout(ms, operation) / .network(url, method, status?) / .internal(errorId)`],check:[`TypedError.isTypedError(v)`,`TypedError.hasCode(e, code)`],other:[`Fields: .code, .message, .status (HTTP), .context, .timestamp, .traceId?`,`VALIDATION_FAILED context shape: { field, value, rule }`]}},Validation:{description:`Error-accumulating validation (functype's Validated role) — FormValidation<T> collects all field errors, not fail-fast.`,interfaces:[],methods:{create:[`Validation.rule<T>('min:18' | 'email' | 'required' | 'in:a,b' | ...)`,`Validation.combine(...validators) / Validation.custom(predicate, message)`,`Validation.validators.email / .url / .uuid / .required / .numeric / .positiveNumber / .nonEmptyString`],transform:[`Validation.form(schema, data) → FormValidation<T> (accumulates all field errors)`,`Validator<T> = (value: unknown) => Either<TypedError<'VALIDATION_FAILED'>, T>`],other:[`FormValidation<T> = Either<List<TypedError<"VALIDATION_FAILED">>, T> — functype's "Validated" accumulating result type`,`form() is flat/per-field: for cross-field (lo < hi) or dynamic-key (weights.*) checks, hand-accumulate into a List<TypedError> and return the FormValidation shape`]}}},a={Functor:{description:`Transform contained values`,methods:[`.map<B>(f: A => B): Functor<B>`]},Applicative:{extends:`Functor`,description:`Apply wrapped functions`,methods:[`.ap<B>(ff: Applicative<A => B>): Applicative<B>`]},Monad:{extends:`Applicative`,description:`Chain operations returning wrapped values`,methods:[`.flatMap<B>(f: A => Monad<B>): Monad<B>`]},Foldable:{description:`Extract via pattern matching`,methods:[`.fold<B>(empty: () => B, f: A => B): B`,`.foldLeft<B>(z: B, op: (B, A) => B): B`,`.foldRight<B>(z: B, op: (A, B) => B): B`]},Extractable:{description:`Get contained value with fallback`,methods:[`.orElse(d: T): T`,`.orThrow(e?: Error): T`,`.expect(handler: (e?) => never): T`,`.orNull(): T | null`,`.orUndefined(): T | undefined`]},Matchable:{description:`Pattern match on type variants`,methods:[`.match<R>(patterns: Record<Tag, Handler>): R`]},Traversable:{description:`Iterate and check contents`,methods:[`.size: number`,`.isEmpty: boolean`,`.contains(v: A): boolean`,`.reduce<B>(f, init): B`]},Collection:{description:`Collection operations`,methods:[`.toArray(): A[]`,`.forEach(f: A => void): void`]},Serializable:{description:`Convert to string formats`,methods:[`.serialize().toJSON(): string`,`.serialize().toYAML(): string`]}},o={Core:[`Option`,`Either`,`Try`,`Obj`,`Identity`],Collection:[`List`,`Set`,`Map`,`LazyList`,`Tuple`,`Stack`],Effect:[`IO`,`Exit`,`Task`,`TaskOutcome`,`TaskResult`,`Http`,`HttpError`,`Decoder`,`DecoderError`],Utility:[`Lazy`,`Cond`,`Match`,`Do`,`Ref`,`Brand`,`ValidatedBrand`,`Wire`,`TracedOption`],Validation:[`TypedError`,`Validation`],Serialization:[`Serialization`,`SerializedError`],Service:[`Logger`,`Tracer`]},s={Option:`export interface Option<out T extends Type>
|
|
2
2
|
extends Functype<T, "Some" | "None">, Promisable<T>, Doable<T>, Reshapeable<T> {
|
|
3
3
|
/** The contained value (undefined for None) */
|
|
4
4
|
readonly value: T | undefined
|
package/dist/functype/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { An as FunctypeCollection, Dn as FunctypeSum, On as Functype, kn as FunctypeBase } from "../index-CEUB9MHA.js";
|
|
2
2
|
export { Functype, FunctypeBase, FunctypeCollection, FunctypeSum };
|
|
@@ -4394,7 +4394,7 @@ declare const TestClock: {
|
|
|
4394
4394
|
/**
|
|
4395
4395
|
* Creates an IO that accesses the TestClock from the environment.
|
|
4396
4396
|
*/
|
|
4397
|
-
get: IO<TestClock, never, TestClock>;
|
|
4397
|
+
readonly get: IO<TestClock, never, TestClock>;
|
|
4398
4398
|
/**
|
|
4399
4399
|
* Creates an IO that advances the TestClock.
|
|
4400
4400
|
*/
|
|
@@ -4406,7 +4406,7 @@ declare const TestClock: {
|
|
|
4406
4406
|
/**
|
|
4407
4407
|
* Creates an IO that runs all pending tasks.
|
|
4408
4408
|
*/
|
|
4409
|
-
runAll: IO<TestClock,
|
|
4409
|
+
readonly runAll: IO<TestClock, never, void>;
|
|
4410
4410
|
/**
|
|
4411
4411
|
* Creates a context with a TestClock for testing.
|
|
4412
4412
|
*/
|
|
@@ -5630,6 +5630,105 @@ declare const Stack: (<A extends Type>(values?: A[]) => Stack<A>) & {
|
|
|
5630
5630
|
fromBinary: <A>(binary: string) => Stack<A>;
|
|
5631
5631
|
};
|
|
5632
5632
|
//#endregion
|
|
5633
|
+
//#region src/traced/TraceEvent.d.ts
|
|
5634
|
+
/**
|
|
5635
|
+
* Identifies which combinator emitted this event.
|
|
5636
|
+
* String union is open so callers can extend with custom ops.
|
|
5637
|
+
*/
|
|
5638
|
+
type TraceOp = "map" | "flatMap" | "filter" | "fold" | "orElse" | "unwrap" | (string & {});
|
|
5639
|
+
/**
|
|
5640
|
+
* One observation emitted by a TracedOption combinator.
|
|
5641
|
+
*
|
|
5642
|
+
* @field spanId - Groups all events from one chain together. Stable across re-wraps.
|
|
5643
|
+
* @field seq - Monotonic 0-based position within the span.
|
|
5644
|
+
* @field op - Which combinator fired.
|
|
5645
|
+
* @field tag - The container type name (e.g. "Option") from Symbol.toStringTag.
|
|
5646
|
+
* @field inTag - Variant entering the op ("Some" | "None" for Option).
|
|
5647
|
+
* @field outTag - Variant leaving the op; absent for terminal ops.
|
|
5648
|
+
* @field label - Optional caller-supplied code-path name.
|
|
5649
|
+
* @field meta - Op-specific detail (e.g. { kept: boolean } for filter).
|
|
5650
|
+
*/
|
|
5651
|
+
type TraceEvent = {
|
|
5652
|
+
readonly spanId: string;
|
|
5653
|
+
readonly seq: number;
|
|
5654
|
+
readonly op: TraceOp;
|
|
5655
|
+
readonly tag: string;
|
|
5656
|
+
readonly inTag: string;
|
|
5657
|
+
readonly outTag?: string;
|
|
5658
|
+
readonly label?: string;
|
|
5659
|
+
readonly meta?: Record<string, unknown>;
|
|
5660
|
+
};
|
|
5661
|
+
//#endregion
|
|
5662
|
+
//#region src/traced/Tracer.d.ts
|
|
5663
|
+
/**
|
|
5664
|
+
* A sink for structured trace events emitted by `TracedOption` chains.
|
|
5665
|
+
*
|
|
5666
|
+
* Type-only — no runtime, no opinion on output format, no `console`-global
|
|
5667
|
+
* dependency. Same rationale as `Logger`: core names the contract, consumers
|
|
5668
|
+
* own the implementation. The whole surface is one method, so the common
|
|
5669
|
+
* implementations are literals at the call site:
|
|
5670
|
+
*
|
|
5671
|
+
* ```ts
|
|
5672
|
+
* const noop: Tracer = { emit: () => undefined }
|
|
5673
|
+
* const collecting = (target: TraceEvent[]): Tracer => ({ emit: (e) => void target.push(e) })
|
|
5674
|
+
* const viaLogger = (logger: Logger): Tracer => ({ emit: (e) => logger.debug("trace", e) })
|
|
5675
|
+
* ```
|
|
5676
|
+
*
|
|
5677
|
+
* For dependency injection, declare your own Tag — `Tag` and `Layer` are
|
|
5678
|
+
* public from `functype/io`, and core deliberately does not reserve an id:
|
|
5679
|
+
*
|
|
5680
|
+
* ```ts
|
|
5681
|
+
* const Tracer = Tag<Tracer>("app/Tracer")
|
|
5682
|
+
* program.provideLayer(Layer.succeed(Tracer, { emit }))
|
|
5683
|
+
* ```
|
|
5684
|
+
*/
|
|
5685
|
+
interface Tracer {
|
|
5686
|
+
emit(event: TraceEvent): void;
|
|
5687
|
+
}
|
|
5688
|
+
//#endregion
|
|
5689
|
+
//#region src/traced/TracedOption.d.ts
|
|
5690
|
+
/**
|
|
5691
|
+
* A wrapper around `Option<A>` that emits a `TraceEvent` to the
|
|
5692
|
+
* injected `Tracer` on every combinator call.
|
|
5693
|
+
*
|
|
5694
|
+
* Structure-preserving ops return `TracedOption<B>`, carrying the same spanId
|
|
5695
|
+
* and incrementing seq. Terminal ops (`fold`, `orElse`) emit and return the
|
|
5696
|
+
* raw value, exiting the wrapper. `unwrap()` emits a terminal event too, so a
|
|
5697
|
+
* span never ends without one.
|
|
5698
|
+
*
|
|
5699
|
+
* @example
|
|
5700
|
+
* ```ts
|
|
5701
|
+
* declare const user: Option<{ name: string }>
|
|
5702
|
+
* const events: TraceEvent[] = []
|
|
5703
|
+
* const tracer = { emit: (e: TraceEvent) => void events.push(e) }
|
|
5704
|
+
*
|
|
5705
|
+
* TracedOption(user, tracer, "span-1")
|
|
5706
|
+
* .map(u => u.name.trim(), "trim")
|
|
5707
|
+
* .filter(n => n.length > 0, "non-empty")
|
|
5708
|
+
* .orElse("anonymous", "fallback")
|
|
5709
|
+
* ```
|
|
5710
|
+
*/
|
|
5711
|
+
type TracedOption<A> = {
|
|
5712
|
+
map<B>(f: (a: A) => B, label?: string): TracedOption<B>;
|
|
5713
|
+
flatMap<B>(f: (a: A) => Option<B>, label?: string): TracedOption<B>;
|
|
5714
|
+
filter(predicate: (a: A) => boolean, label?: string): TracedOption<A>;
|
|
5715
|
+
fold<B>(onNone: () => B, onSome: (a: A) => B, label?: string): B;
|
|
5716
|
+
orElse<B>(defaultValue: B, label?: string): A | B;
|
|
5717
|
+
unwrap(): Option<A>;
|
|
5718
|
+
};
|
|
5719
|
+
/**
|
|
5720
|
+
* Wraps `inner` with tracing. Each combinator emits one `TraceEvent` to `tracer`,
|
|
5721
|
+
* then delegates to the real Option implementation.
|
|
5722
|
+
*
|
|
5723
|
+
* @param inner - The Option to wrap.
|
|
5724
|
+
* @param tracer - Receives events. Typically obtained via IO.service(Tracer).
|
|
5725
|
+
* @param spanId - Groups all events from one chain. Required: core does not
|
|
5726
|
+
* generate ids, so tracing stays deterministic and free of a
|
|
5727
|
+
* global `crypto` dependency.
|
|
5728
|
+
* @param seq - Starting sequence number. Defaults to 0. Increments on each op.
|
|
5729
|
+
*/
|
|
5730
|
+
declare function TracedOption<A>(inner: Option<A>, tracer: Tracer, spanId: string, seq?: number): TracedOption<A>;
|
|
5731
|
+
//#endregion
|
|
5633
5732
|
//#region src/option/Option.d.ts
|
|
5634
5733
|
/**
|
|
5635
5734
|
* Option type module
|
|
@@ -6185,4 +6284,4 @@ declare const Match: (<T extends Type>(value: T) => UntypedMatch<T>) & {
|
|
|
6185
6284
|
};
|
|
6186
6285
|
};
|
|
6187
6286
|
//#endregion
|
|
6188
|
-
export {
|
|
6287
|
+
export { TimeoutError as $, SerializedError as $n, TaggedThrowable as $t, Http as A, FunctypeCollection as An, Doable as Ar, safeStringify as At, HttpError as B, Serialization_d_exports as Bn, NoneError as Bt, HKT as C, UUID as Cn, Monad as Cr, ErrorChainElement as Ct, TryKind as D, FunctypeSum as Dn, isExtractable as Dr, createErrorSerializer as Dt, OptionKind as E, ValidatedBrandCompanion as En, Extractable as Er, TaskErrorInfo as Et, HttpRequestOptions as F, Set as Fn, EmptyListError as Ft, TestClock as G, createSerializationCompanion as Gn, DecoderErrorComposite as Gt, HttpStatusError as H, FunctypeEnvelope as Hn, unwrap as Ht, HttpRequestView as I, List as In, FailureError as It, IO as J, envelope as Jn, CancellationToken as Jt, TestClockTag as K, createSerializer as Kn, DecoderErrorLeaf as Kt, HttpResponse as L, Try as Ln, FailureErrorType as Lt, HttpClientConfig as M, Matchable as Mn, Do as Mt, HttpMethodOptions as N, MatchableUtils as Nn, DoAsync as Nt, UniversalContainer as O, Functype as On, ParseError as Or, formatError as Ot, HttpQueryParams as P, Collection as Pn, DoGenerator as Pt, Task as Q, taggedEnvelope as Qn, Sync as Qt, ParseMode as R, TypeNames as Rn, LeftError as Rt, EitherKind as S, PositiveNumber as Sn, Functor as Sr, TypedErrorContext as St, ListKind as T, ValidatedBrand as Tn, ContainerOps as Tr, ErrorWithTaskInfo as Tt, NetworkError as U, SerializationResult as Un, Decoder as Ut, HttpMethod as V, FUNCTYPE_MARKER as Vn, isDoCapable as Vt, ResponseDecodeError as W, createCustomSerializer as Wn, DecoderError as Wt, RIO as X, fromJSON as Xn, Err as Xt, InterruptedError as Y, fromBinary as Yn, CancellationTokenSource as Yt, RepeatExhausted as Z, fromYAML as Zn, Ok as Zt, ESMapType as _, IntegerNumber as _n, reduceRightWiden as _r, Validator as _t, OptionConstructor as a, TaskResult as an, Left as ar, LayerOutput as at, Lazy as b, PatternString as bn, Applicative as br, ErrorStatus as bt, Tracer as c, isTaggedThrowable as cn, RightOf as cr, Context as ct, Stack as d, ThrowableType as dn, TypeCheckRight as dr, Tag as dt, Task$1 as en, deserializeError as er, UIO as et, Valuable as f, Base as fn, isLeft as fr, TagService as ft, ESMap as g, ISO8601Date as gn, Widen as gr, ValidationRule as gt, Obj as h, EmailAddress as hn, tryCatchAsync as hr, Validation as ht, Option as i, TaskParams as in, EitherBase as ir, LayerInput as it, HttpClient as j, Traversable as jn, Cond as jr, $ as jt, FoldableUtils as k, FunctypeBase as kn, DoResult as kr, formatStackTrace as kt, TraceEvent as l, NAME as ln, TestEither as lr, ContextServices as lt, Ref as m, BoundedString as mn, tryCatch as mr, FormValidation as mt, UntypedMatch as n, TaskMetadata as nn, LazyList as nr, Layer as nt, Some as o, TaskSuccess as on, LeftOf as or, Exit as ot, ValuableParams as p, BoundedNumber as pn, isRight as pr, FieldValidation as pt, TestContext as q, createTaggedSerializer as qn, Async as qt, None as r, TaskOutcome as rn, Either as rr, LayerError as rt, TracedOption as s, createCancellationTokenSource as sn, Right as sr, ExitTag as st, Match as t, TaskFailure as tn, serializeError as tr, UnsupportedSyncOperationError as tt, TraceOp as u, Throwable as un, TypeCheckLeft as ur, HasService as ut, Map$1 as v, NonEmptyString as vn, reduceWiden as vr, ErrorCode as vt, Kind as w, UrlString as wn, CollectionOps as wr, ErrorFormatterOptions as wt, Identity as x, PositiveInteger as xn, AsyncMonad as xr, TypedError as xt, KVTraversable as y, NonNegativeNumber as yn, Promisable as yr, ErrorMessage as yt, DecodeError as z, JSONValue as zn, LeftErrorType as zt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as ExtractBrand, c as hasBrand, i as BrandedString, l as unwrapBrand, n as BrandedBoolean, o as Unwrap, r as BrandedNumber, s as createBrander, t as Brand } from "./Brand-bfnGXuum.js";
|
|
2
2
|
import { i as Companion, n as InstanceType, r as isCompanion, t as CompanionMethods } from "./CompanionTypes-Cc90cQ4P.js";
|
|
3
3
|
import { a as isTypeable, c as SerializationMethods, d as Type, i as TypeableParams, l as Pipe, n as ExtractTag, o as Serializable, r as Typeable, s as SerializableEnvelope, t as Tuple, u as Foldable } from "./Tuple-B8KM-H8Y.js";
|
|
4
|
-
import { $ as
|
|
4
|
+
import { $ as TimeoutError, $n as SerializedError, $t as TaggedThrowable, A as Http, An as FunctypeCollection, Ar as Doable, At as safeStringify, B as HttpError, Bn as Serialization_d_exports, Bt as NoneError, C as HKT, Cn as UUID, Cr as Monad, Ct as ErrorChainElement, D as TryKind, Dn as FunctypeSum, Dr as isExtractable, Dt as createErrorSerializer, E as OptionKind, En as ValidatedBrandCompanion, Er as Extractable, Et as TaskErrorInfo, F as HttpRequestOptions, Fn as Set, Ft as EmptyListError, G as TestClock, Gn as createSerializationCompanion, Gt as DecoderErrorComposite, H as HttpStatusError, Hn as FunctypeEnvelope, Ht as unwrap, I as HttpRequestView, In as List, It as FailureError, J as IO, Jn as envelope, Jt as CancellationToken, K as TestClockTag, Kn as createSerializer, Kt as DecoderErrorLeaf, L as HttpResponse, Ln as Try, Lt as FailureErrorType, M as HttpClientConfig, Mn as Matchable, Mt as Do, N as HttpMethodOptions, Nn as MatchableUtils, Nt as DoAsync, O as UniversalContainer, On as Functype, Or as ParseError, Ot as formatError, P as HttpQueryParams, Pn as Collection, Pt as DoGenerator, Q as Task, Qn as taggedEnvelope, Qt as Sync, R as ParseMode, Rn as TypeNames, Rt as LeftError, S as EitherKind, Sn as PositiveNumber, Sr as Functor, St as TypedErrorContext, T as ListKind, Tn as ValidatedBrand, Tr as ContainerOps, Tt as ErrorWithTaskInfo, U as NetworkError, Un as SerializationResult, Ut as Decoder, V as HttpMethod, Vn as FUNCTYPE_MARKER, Vt as isDoCapable, W as ResponseDecodeError, Wn as createCustomSerializer, Wt as DecoderError, X as RIO, Xn as fromJSON, Xt as Err, Y as InterruptedError, Yn as fromBinary, Yt as CancellationTokenSource, Z as RepeatExhausted, Zn as fromYAML, Zt as Ok, _ as ESMapType, _n as IntegerNumber, _r as reduceRightWiden, _t as Validator, a as OptionConstructor, an as TaskResult, ar as Left, at as LayerOutput, b as Lazy, bn as PatternString, br as Applicative, bt as ErrorStatus, c as Tracer, cn as isTaggedThrowable, cr as RightOf, ct as Context, d as Stack, dn as ThrowableType, dr as TypeCheckRight, dt as Tag, en as Task$1, er as deserializeError, et as UIO, f as Valuable, fn as Base, fr as isLeft, ft as TagService, g as ESMap, gn as ISO8601Date, gr as Widen, gt as ValidationRule, h as Obj, hn as EmailAddress, hr as tryCatchAsync, ht as Validation, i as Option, in as TaskParams, ir as EitherBase, it as LayerInput, j as HttpClient, jn as Traversable, jr as Cond, jt as $, k as FoldableUtils, kn as FunctypeBase, kr as DoResult, kt as formatStackTrace, l as TraceEvent, ln as NAME, lr as TestEither, lt as ContextServices, m as Ref, mn as BoundedString, mr as tryCatch, mt as FormValidation, n as UntypedMatch, nn as TaskMetadata, nr as LazyList, nt as Layer, o as Some, on as TaskSuccess, or as LeftOf, ot as Exit, p as ValuableParams, pn as BoundedNumber, pr as isRight, pt as FieldValidation, q as TestContext, qn as createTaggedSerializer, qt as Async, r as None, rn as TaskOutcome, rr as Either, rt as LayerError, s as TracedOption, sn as createCancellationTokenSource, sr as Right, st as ExitTag, t as Match, tn as TaskFailure, tr as serializeError, tt as UnsupportedSyncOperationError, u as TraceOp, un as Throwable, ur as TypeCheckLeft, ut as HasService, v as Map, vn as NonEmptyString, vr as reduceWiden, vt as ErrorCode, w as Kind, wn as UrlString, wr as CollectionOps, wt as ErrorFormatterOptions, x as Identity, xn as PositiveInteger, xr as AsyncMonad, xt as TypedError, y as KVTraversable, yn as NonNegativeNumber, yr as Promisable, yt as ErrorMessage, z as DecodeError, zn as JSONValue, zt as LeftErrorType } from "./index-CEUB9MHA.js";
|
|
5
5
|
import { t as Logger } from "./Logger-BmprRS8v.js";
|
|
6
|
-
import { t as Wire } from "./Wire-
|
|
7
|
-
export { $, type Applicative, Async, type AsyncMonad, Base, BoundedNumber, BoundedString, Brand, BrandedBoolean, type BrandedBoolean as BrandedBooleanType, BrandedNumber, type BrandedNumber as BrandedNumberType, BrandedString, type BrandedString as BrandedStringType, CancellationToken, CancellationTokenSource, Collection, type CollectionOps, Companion, CompanionMethods, Cond, type ContainerOps, Context, type Context as ContextType, type ContextServices, type DecodeError, Decoder, DecoderError, type DecoderErrorComposite, type DecoderErrorLeaf, Do, DoAsync, DoGenerator, type DoResult, type Doable, ESMap, ESMapType, Either, EitherBase, EitherKind, EmailAddress, EmptyListError, Err, ErrorChainElement, ErrorCode, ErrorFormatterOptions, ErrorMessage, ErrorStatus, ErrorWithTaskInfo, Exit, type Exit as ExitType, type ExitTag, type ExtractBrand, ExtractTag, type Extractable, FUNCTYPE_MARKER, FailureError, FailureErrorType, FieldValidation, Foldable, FoldableUtils, FormValidation, type Functor, Functype, FunctypeBase, FunctypeCollection, FunctypeEnvelope, FunctypeSum, HKT, type HasService, Http, HttpClient, type HttpClientConfig, type HttpError, HttpError as HttpErrors, type HttpMethod, type HttpMethodOptions, type HttpQueryParams, type HttpRequestOptions, type HttpRequestView, type HttpResponse, type HttpStatusError, IO, type IO as IOType, type Task as IOTask, ISO8601Date, Identity, InstanceType, IntegerNumber, InterruptedError, type JSONValue, KVTraversable, Kind, Layer, type Layer as LayerType, type LayerError, type LayerInput, type LayerOutput, Lazy, type Lazy as LazyType, LazyList, Left, LeftError, LeftErrorType, LeftOf, List, ListKind, type Logger, Map, Match, type Matchable, MatchableUtils, type Monad, NAME, type NetworkError, NonEmptyString, NonNegativeNumber, None, NoneError, Obj, Ok, Option, OptionConstructor, OptionKind, ParseError, type ParseMode, PatternString, Pipe, PositiveInteger, PositiveNumber, type Promisable, type RIO, Ref, type Ref as RefType, RepeatExhausted, type ResponseDecodeError, Right, RightOf, Serializable, SerializableEnvelope, Serialization_d_exports as Serialization, SerializationMethods, SerializationResult, SerializedError, Set, Some, Stack, Sync, Tag, type Tag as TagType, type TagService, TaggedThrowable, Task$1 as Task, TaskErrorInfo, TaskFailure, TaskMetadata, TaskOutcome, TaskParams, TaskResult, TaskSuccess, TestClock, type TestClock as TestClockType, TestClockTag, TestContext, type TestContext as TestContextType, TestEither, Throwable, ThrowableType, TimeoutError, Traversable, Try, TryKind, Tuple, Type, TypeCheckLeft, TypeCheckRight, TypeNames, Typeable, TypeableParams, TypedError, TypedErrorContext, type UIO, UUID, UniversalContainer, UnsupportedSyncOperationError, UntypedMatch, type Unwrap, UrlString, ValidatedBrand, type ValidatedBrand as ValidatedBrandType, type ValidatedBrandCompanion, Validation, ValidationRule, Validator, Valuable, ValuableParams, type Widen, type Wire, createBrander, createCancellationTokenSource, createCustomSerializer, createErrorSerializer, createSerializationCompanion, createSerializer, createTaggedSerializer, deserializeError, envelope, formatError, formatStackTrace, fromBinary, fromJSON, fromYAML, hasBrand, isCompanion, isDoCapable, isExtractable, isLeft, isRight, isTaggedThrowable, isTypeable, reduceRightWiden, reduceWiden, safeStringify, serializeError, taggedEnvelope, tryCatch, tryCatchAsync, unwrap, unwrapBrand };
|
|
6
|
+
import { n as WireMark, t as Wire } from "./Wire-3hvw0Ogg.js";
|
|
7
|
+
export { $, type Applicative, Async, type AsyncMonad, Base, BoundedNumber, BoundedString, Brand, BrandedBoolean, type BrandedBoolean as BrandedBooleanType, BrandedNumber, type BrandedNumber as BrandedNumberType, BrandedString, type BrandedString as BrandedStringType, CancellationToken, CancellationTokenSource, Collection, type CollectionOps, Companion, CompanionMethods, Cond, type ContainerOps, Context, type Context as ContextType, type ContextServices, type DecodeError, Decoder, DecoderError, type DecoderErrorComposite, type DecoderErrorLeaf, Do, DoAsync, DoGenerator, type DoResult, type Doable, ESMap, ESMapType, Either, EitherBase, EitherKind, EmailAddress, EmptyListError, Err, ErrorChainElement, ErrorCode, ErrorFormatterOptions, ErrorMessage, ErrorStatus, ErrorWithTaskInfo, Exit, type Exit as ExitType, type ExitTag, type ExtractBrand, ExtractTag, type Extractable, FUNCTYPE_MARKER, FailureError, FailureErrorType, FieldValidation, Foldable, FoldableUtils, FormValidation, type Functor, Functype, FunctypeBase, FunctypeCollection, FunctypeEnvelope, FunctypeSum, HKT, type HasService, Http, HttpClient, type HttpClientConfig, type HttpError, HttpError as HttpErrors, type HttpMethod, type HttpMethodOptions, type HttpQueryParams, type HttpRequestOptions, type HttpRequestView, type HttpResponse, type HttpStatusError, IO, type IO as IOType, type Task as IOTask, ISO8601Date, Identity, InstanceType, IntegerNumber, InterruptedError, type JSONValue, KVTraversable, Kind, Layer, type Layer as LayerType, type LayerError, type LayerInput, type LayerOutput, Lazy, type Lazy as LazyType, LazyList, Left, LeftError, LeftErrorType, LeftOf, List, ListKind, type Logger, Map, Match, type Matchable, MatchableUtils, type Monad, NAME, type NetworkError, NonEmptyString, NonNegativeNumber, None, NoneError, Obj, Ok, Option, OptionConstructor, OptionKind, ParseError, type ParseMode, PatternString, Pipe, PositiveInteger, PositiveNumber, type Promisable, type RIO, Ref, type Ref as RefType, RepeatExhausted, type ResponseDecodeError, Right, RightOf, Serializable, SerializableEnvelope, Serialization_d_exports as Serialization, SerializationMethods, SerializationResult, SerializedError, Set, Some, Stack, Sync, Tag, type Tag as TagType, type TagService, TaggedThrowable, Task$1 as Task, TaskErrorInfo, TaskFailure, TaskMetadata, TaskOutcome, TaskParams, TaskResult, TaskSuccess, TestClock, type TestClock as TestClockType, TestClockTag, TestContext, type TestContext as TestContextType, TestEither, Throwable, ThrowableType, TimeoutError, type TraceEvent, type TraceOp, TracedOption, type Tracer, Traversable, Try, TryKind, Tuple, Type, TypeCheckLeft, TypeCheckRight, TypeNames, Typeable, TypeableParams, TypedError, TypedErrorContext, type UIO, UUID, UniversalContainer, UnsupportedSyncOperationError, UntypedMatch, type Unwrap, UrlString, ValidatedBrand, type ValidatedBrand as ValidatedBrandType, type ValidatedBrandCompanion, Validation, ValidationRule, Validator, Valuable, ValuableParams, type Widen, type Wire, type WireMark, createBrander, createCancellationTokenSource, createCustomSerializer, createErrorSerializer, createSerializationCompanion, createSerializer, createTaggedSerializer, deserializeError, envelope, formatError, formatStackTrace, fromBinary, fromJSON, fromYAML, hasBrand, isCompanion, isDoCapable, isExtractable, isLeft, isRight, isTaggedThrowable, isTypeable, reduceRightWiden, reduceWiden, safeStringify, serializeError, taggedEnvelope, tryCatch, tryCatchAsync, unwrap, unwrapBrand };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Brand as e,BrandedBoolean as t,BrandedNumber as n,BrandedString as r,createBrander as i,hasBrand as a,unwrap as o}from"./branded/index.js";import{$ as s,A as c,At as l,B as u,C as d,Ct as f,D as p,Dt as m,E as h,Et as g,F as _,
|
|
1
|
+
import{Brand as e,BrandedBoolean as t,BrandedNumber as n,BrandedString as r,createBrander as i,hasBrand as a,unwrap as o}from"./branded/index.js";import{$ as s,A as c,At as l,B as u,C as d,Ct as f,D as p,Dt as m,E as h,Et as g,F as _,Ft as v,G as y,H as b,I as x,J as S,K as C,L as w,M as T,Mt as E,N as D,Nt as O,O as k,Ot as A,P as j,Pt as M,Q as N,R as P,S as F,St as I,T as L,Tt as R,U as z,V as B,W as V,X as H,Y as U,Z as W,_ as G,_t as K,a as q,at as J,b as Y,bt as X,c as Z,ct as Q,d as $,dt as ee,et as te,f as ne,ft as re,g as ie,gt as ae,h as oe,ht as se,i as ce,it as le,j as ue,jt as de,k as fe,kt as pe,l as me,lt as he,m as ge,mt as _e,n as ve,nt as ye,o as be,ot as xe,p as Se,pt as Ce,q as we,r as Te,rt as Ee,s as De,st as Oe,t as ke,tt as Ae,u as je,ut as Me,v as Ne,vt as Pe,w as Fe,wt as Ie,x as Le,xt as Re,y as ze,yt as Be,z as Ve}from"./src-Bpdfpk6R.js";import{t as He}from"./Companion-DiOMBHDG.js";import{a as Ue,c as We,d as Ge,f as Ke,i as qe,l as Je,n as Ye,o as Xe,r as Ze,s as Qe,t as $e,u as et}from"./serialization-CpbxaV0t.js";import{n as tt,t as nt}from"./typeclass-C61yDVYd.js";import{t as rt}from"./CompanionTypes-BVqO7Kc2.js";import{Tuple as it}from"./tuple/index.js";export{D as $,s as Base,ye as BoundedNumber,Ee as BoundedString,e as Brand,t as BrandedBoolean,n as BrandedNumber,r as BrandedString,He as Companion,Ae as Cond,L as Context,b as Decoder,z as DecoderError,j as Do,_ as DoAsync,y as ESMap,se as Either,le as EmailAddress,x as EmptyListError,C as Err,Fe as Exit,$e as FUNCTYPE_MARKER,w as FailureError,je as FoldableUtils,me as HKT,$ as Http,Se as HttpClient,ne as HttpErrors,ze as IO,J as ISO8601Date,Z as Identity,xe as IntegerNumber,Y as InterruptedError,Ne as Layer,De as Lazy,A as LazyList,ae as Left,P as LeftError,Ie as List,V as Map,te as Match,be as MatchableUtils,W as NAME,Oe as NonEmptyString,Q as NonNegativeNumber,de as None,Ve as NoneError,q as Obj,we as Ok,E as Option,O as OptionConstructor,v as ParseError,he as PatternString,Me as PositiveInteger,ee as PositiveNumber,pe as Ref,Le as RepeatExhausted,K as Right,Te as Serialization,l as Set,M as Some,ce as Stack,G as Tag,S as Task,ge as TestClock,oe as TestClockTag,ie as TestContext,N as Throwable,F as TimeoutError,ve as TracedOption,m as Try,it as Tuple,Pe as TypeCheckLeft,Be as TypeCheckRight,R as Typeable,k as TypedError,re as UUID,d as UnsupportedSyncOperationError,Ce as UrlString,_e as ValidatedBrand,p as Validation,ke as Valuable,i as createBrander,U as createCancellationTokenSource,Ye as createCustomSerializer,fe as createErrorSerializer,Ze as createSerializationCompanion,qe as createSerializer,Ue as createTaggedSerializer,Ge as deserializeError,Xe as envelope,c as formatError,ue as formatStackTrace,Qe as fromBinary,We as fromJSON,Je as fromYAML,a as hasBrand,rt as isCompanion,u as isDoCapable,h as isExtractable,X as isLeft,Re as isRight,H as isTaggedThrowable,g as isTypeable,nt as reduceRightWiden,tt as reduceWiden,T as safeStringify,Ke as serializeError,et as taggedEnvelope,I as tryCatch,f as tryCatchAsync,B as unwrap,o as unwrapBrand};
|
package/dist/io/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as TimeoutError, G as TestClock, J as IO, K as TestClockTag, Q as Task, X as RIO, Y as InterruptedError, Z as RepeatExhausted, at as LayerOutput, ct as Context, dt as Tag, et as UIO, ft as TagService, it as LayerInput, lt as ContextServices, nt as Layer, ot as Exit, q as TestContext, rt as LayerError, st as ExitTag, tt as UnsupportedSyncOperationError, ut as HasService } from "../index-CEUB9MHA.js";
|
|
2
2
|
export { Context, type Context as ContextType, type ContextServices, Exit, type Exit as ExitType, type ExitTag, type HasService, IO, type IO as IOType, type Task as IOTask, InterruptedError, Layer, type Layer as LayerType, type LayerError, type LayerInput, type LayerOutput, type RIO, RepeatExhausted, Tag, type Tag as TagType, type TagService, TestClock, type TestClock as TestClockType, TestClockTag, TestContext, type TestContext as TestContextType, TimeoutError, type UIO, UnsupportedSyncOperationError };
|
package/dist/io/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,S as t,
|
|
1
|
+
import{C as e,S as t,T as n,_ as r,b as i,g as a,h as o,m as s,v as c,w as l,x as u,y as d}from"../src-Bpdfpk6R.js";export{n as Context,l as Exit,d as IO,i as InterruptedError,c as Layer,u as RepeatExhausted,r as Tag,s as TestClock,o as TestClockTag,a as TestContext,t as TimeoutError,e as UnsupportedSyncOperationError};
|