functype 0.20.2 → 0.40.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 +8 -15
- package/README.processed.md +2 -11
- package/dist/{Brand-B-0nKo7I.d.ts → Brand-BPeggBaO.d.ts} +16 -16
- package/dist/{Tuple-CKxIyX7l.d.ts → Tuple-C4maYbiO.d.ts} +8 -8
- package/dist/branded/index.d.ts +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/do/index.d.ts +3 -3
- package/dist/do/index.js +1 -1
- package/dist/either/index.d.ts +3 -3
- package/dist/either/index.js +1 -1
- package/dist/fpromise/index.d.ts +3 -3
- package/dist/fpromise/index.js +1 -1
- package/dist/{index-Bnjlo4cT.d.ts → index-Bn_yRBx8.d.ts} +1697 -341
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/list/index.d.ts +3 -3
- package/dist/list/index.js +1 -1
- package/dist/map/index.d.ts +3 -3
- package/dist/map/index.js +1 -1
- package/dist/option/index.d.ts +3 -3
- package/dist/option/index.js +1 -1
- package/dist/set/index.d.ts +3 -3
- package/dist/set/index.js +1 -1
- package/dist/src-JcsaR9MX.js +20 -0
- package/dist/src-JcsaR9MX.js.map +1 -0
- package/dist/try/index.d.ts +3 -3
- package/dist/try/index.js +1 -1
- package/dist/tuple/index.d.ts +1 -1
- package/package.json +11 -5
- package/dist/src-BOxI0-73.js +0 -20
- package/dist/src-BOxI0-73.js.map +0 -1
package/README.md
CHANGED
|
@@ -608,12 +608,7 @@ All data structures implement the `Functype` hierarchy:
|
|
|
608
608
|
```typescript
|
|
609
609
|
// Base interface for all data structures
|
|
610
610
|
interface FunctypeBase<A, Tag>
|
|
611
|
-
extends AsyncMonad<A>,
|
|
612
|
-
Traversable<A>,
|
|
613
|
-
Serializable<A>,
|
|
614
|
-
Foldable<A>,
|
|
615
|
-
Typeable<Tag>,
|
|
616
|
-
ContainerOps<A> {
|
|
611
|
+
extends AsyncMonad<A>, Traversable<A>, Serializable<A>, Foldable<A>, Typeable<Tag>, ContainerOps<A> {
|
|
617
612
|
readonly _tag: Tag
|
|
618
613
|
}
|
|
619
614
|
|
|
@@ -624,11 +619,7 @@ interface Functype<A, Tag> extends FunctypeBase<A, Tag>, Extractable<A>, Pipe<A>
|
|
|
624
619
|
|
|
625
620
|
// For collections (List, Set, Map)
|
|
626
621
|
interface FunctypeCollection<A, Tag>
|
|
627
|
-
extends FunctypeBase<A, Tag>,
|
|
628
|
-
Iterable<A>,
|
|
629
|
-
Pipe<A[]>,
|
|
630
|
-
Collection<A>,
|
|
631
|
-
CollectionOps<A, FunctypeCollection<A, Tag>> {
|
|
622
|
+
extends FunctypeBase<A, Tag>, Iterable<A>, Pipe<A[]>, Collection<A>, CollectionOps<A, FunctypeCollection<A, Tag>> {
|
|
632
623
|
toValue(): { _tag: Tag; value: A[] }
|
|
633
624
|
// Collections work with Iterable instead of Monad
|
|
634
625
|
flatMap<B>(f: (value: A) => Iterable<B>): FunctypeCollection<B, Tag>
|
|
@@ -747,10 +738,12 @@ For more details, see the [Error Formatting Guide](docs/error-formatting.md).
|
|
|
747
738
|
- ✓ Add guard clauses (when conditions)
|
|
748
739
|
- ✓ Support destructuring patterns
|
|
749
740
|
- ✓ Consolidated into unified Match implementation
|
|
750
|
-
- [
|
|
751
|
-
- Lazy execution
|
|
752
|
-
-
|
|
753
|
-
-
|
|
741
|
+
- [x] Implement IO<R,E,A> effect type
|
|
742
|
+
- ✓ Lazy execution with typed errors
|
|
743
|
+
- ✓ Dependency injection (Tag, Context, Layer)
|
|
744
|
+
- ✓ Composable operations (map, flatMap, zip, race)
|
|
745
|
+
- ✓ Resource management (bracket/acquireRelease)
|
|
746
|
+
- ✓ Generator do-notation (IO.gen) and builder (IO.Do)
|
|
754
747
|
|
|
755
748
|
### Low Priority
|
|
756
749
|
|
package/README.processed.md
CHANGED
|
@@ -639,12 +639,7 @@ All data structures implement the `Functype` hierarchy:
|
|
|
639
639
|
```typescript
|
|
640
640
|
// Base interface for all data structures
|
|
641
641
|
interface FunctypeBase<A, Tag>
|
|
642
|
-
extends AsyncMonad<A>,
|
|
643
|
-
Traversable<A>,
|
|
644
|
-
Serializable<A>,
|
|
645
|
-
Foldable<A>,
|
|
646
|
-
Typeable<Tag>,
|
|
647
|
-
ContainerOps<A> {
|
|
642
|
+
extends AsyncMonad<A>, Traversable<A>, Serializable<A>, Foldable<A>, Typeable<Tag>, ContainerOps<A> {
|
|
648
643
|
readonly _tag: Tag
|
|
649
644
|
}
|
|
650
645
|
|
|
@@ -655,11 +650,7 @@ interface Functype<A, Tag> extends FunctypeBase<A, Tag>, Extractable<A>, Pipe<A>
|
|
|
655
650
|
|
|
656
651
|
// For collections (List, Set, Map)
|
|
657
652
|
interface FunctypeCollection<A, Tag>
|
|
658
|
-
extends FunctypeBase<A, Tag>,
|
|
659
|
-
Iterable<A>,
|
|
660
|
-
Pipe<A[]>,
|
|
661
|
-
Collection<A>,
|
|
662
|
-
CollectionOps<A, FunctypeCollection<A, Tag>> {
|
|
653
|
+
extends FunctypeBase<A, Tag>, Iterable<A>, Pipe<A[]>, Collection<A>, CollectionOps<A, FunctypeCollection<A, Tag>> {
|
|
663
654
|
toValue(): { _tag: Tag; value: A[] }
|
|
664
655
|
// Collections work with Iterable instead of Monad
|
|
665
656
|
flatMap<B>(f: (value: A) => Iterable<B>): FunctypeCollection<B, Tag>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/branded/Brand.d.ts
|
|
2
|
-
type Brand<K
|
|
3
|
-
readonly __brand: K
|
|
2
|
+
type Brand<K extends string, T> = T & {
|
|
3
|
+
readonly __brand: K;
|
|
4
4
|
};
|
|
5
5
|
type Unwrap<T> = T extends Brand<string, infer U> ? U : T;
|
|
6
6
|
type ExtractBrand<T> = T extends Brand<infer K, unknown> ? K : never;
|
|
@@ -13,7 +13,7 @@ type ExtractBrand<T> = T extends Brand<infer K, unknown> ? K : never;
|
|
|
13
13
|
* @param value - The value to brand
|
|
14
14
|
* @returns The value with phantom type brand
|
|
15
15
|
*/
|
|
16
|
-
declare function Brand<K
|
|
16
|
+
declare function Brand<K extends string, T>(_brand: K, value: T): Brand<K, T>;
|
|
17
17
|
/**
|
|
18
18
|
* Helper to unwrap a branded value to its underlying type
|
|
19
19
|
* Works with both Brand and ValidatedBrand
|
|
@@ -22,10 +22,10 @@ declare function Brand<K$1 extends string, T>(_brand: K$1, value: T): Brand<K$1,
|
|
|
22
22
|
*
|
|
23
23
|
* Note: Also exported as 'unwrap' from 'functype/branded' for convenience
|
|
24
24
|
*/
|
|
25
|
-
declare function unwrapBrand<K
|
|
26
|
-
declare function unwrapBrand<K
|
|
27
|
-
declare function unwrapBrand<K
|
|
28
|
-
declare function unwrapBrand<K
|
|
25
|
+
declare function unwrapBrand<K extends string, T>(branded: Brand<K, T>): T;
|
|
26
|
+
declare function unwrapBrand<K extends string, T>(branded: Brand<K, T> | null): T | null;
|
|
27
|
+
declare function unwrapBrand<K extends string, T>(branded: Brand<K, T> | undefined): T | undefined;
|
|
28
|
+
declare function unwrapBrand<K extends string, T>(branded: Brand<K, T> | null | undefined): T | null | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* Type guard for checking if a value has a specific brand
|
|
31
31
|
* @param value - The value to check
|
|
@@ -37,19 +37,19 @@ declare function unwrapBrand<K$1 extends string, T>(branded: Brand<K$1, T> | nul
|
|
|
37
37
|
* for non-null values, as we have no way to actually check the brand at runtime.
|
|
38
38
|
* This function is primarily for API consistency and documentation purposes.
|
|
39
39
|
*/
|
|
40
|
-
declare function hasBrand<K
|
|
40
|
+
declare function hasBrand<K extends string, T>(value: unknown, _brand: K): value is Brand<K, T>;
|
|
41
41
|
/**
|
|
42
42
|
* Create a branded type constructor for a specific brand
|
|
43
43
|
* @param brand - The brand name
|
|
44
44
|
* @returns A function that brands values with the specified brand
|
|
45
45
|
*/
|
|
46
|
-
declare function createBrander<K
|
|
47
|
-
type BrandedString<K
|
|
48
|
-
type BrandedNumber<K
|
|
49
|
-
type BrandedBoolean<K
|
|
50
|
-
declare const BrandedString: <K
|
|
51
|
-
declare const BrandedNumber: <K
|
|
52
|
-
declare const BrandedBoolean: <K
|
|
46
|
+
declare function createBrander<K extends string, T>(brand: K): (value: T) => Brand<K, T>;
|
|
47
|
+
type BrandedString<K extends string> = Brand<K, string>;
|
|
48
|
+
type BrandedNumber<K extends string> = Brand<K, number>;
|
|
49
|
+
type BrandedBoolean<K extends string> = Brand<K, boolean>;
|
|
50
|
+
declare const BrandedString: <K extends string>(brand: K) => (value: string) => BrandedString<K>;
|
|
51
|
+
declare const BrandedNumber: <K extends string>(brand: K) => (value: number) => BrandedNumber<K>;
|
|
52
|
+
declare const BrandedBoolean: <K extends string>(brand: K) => (value: boolean) => BrandedBoolean<K>;
|
|
53
53
|
//#endregion
|
|
54
54
|
export { ExtractBrand as a, hasBrand as c, BrandedString as i, unwrapBrand as l, BrandedBoolean as n, Unwrap as o, BrandedNumber as r, createBrander as s, Brand as t };
|
|
55
|
-
//# sourceMappingURL=Brand-
|
|
55
|
+
//# sourceMappingURL=Brand-BPeggBaO.d.ts.map
|
|
@@ -62,16 +62,16 @@ interface Serializable<T> {
|
|
|
62
62
|
* Base interface for objects with a type tag
|
|
63
63
|
* @internal
|
|
64
64
|
*/
|
|
65
|
-
interface TypeableBase<Tag
|
|
66
|
-
readonly _tag: Tag
|
|
65
|
+
interface TypeableBase<Tag extends string> {
|
|
66
|
+
readonly _tag: Tag;
|
|
67
67
|
}
|
|
68
|
-
type Typeable<Tag
|
|
68
|
+
type Typeable<Tag extends string, T = object> = T & TypeableBase<Tag>;
|
|
69
69
|
/**
|
|
70
70
|
* Parameters for creating a Typeable instance
|
|
71
71
|
* @internal
|
|
72
72
|
*/
|
|
73
|
-
type TypeableParams<Tag
|
|
74
|
-
_tag: Tag
|
|
73
|
+
type TypeableParams<Tag extends string, T> = {
|
|
74
|
+
_tag: Tag;
|
|
75
75
|
impl: T;
|
|
76
76
|
};
|
|
77
77
|
/**
|
|
@@ -89,10 +89,10 @@ type ExtractTag<T> = T extends Typeable<infer Tag, unknown> ? Tag : never;
|
|
|
89
89
|
* @typeParam Tag - The string literal type used as the discriminator
|
|
90
90
|
* @typeParam T - The base type to extend with the tag
|
|
91
91
|
*/
|
|
92
|
-
declare function Typeable<Tag
|
|
92
|
+
declare function Typeable<Tag extends string, T>({
|
|
93
93
|
_tag,
|
|
94
94
|
impl
|
|
95
|
-
}: TypeableParams<Tag
|
|
95
|
+
}: TypeableParams<Tag, T>): Typeable<Tag, T>;
|
|
96
96
|
/**
|
|
97
97
|
* Type guard with automatic type inference using the full type
|
|
98
98
|
* @param value - The value to check
|
|
@@ -175,4 +175,4 @@ declare const Tuple: (<T extends Type[]>(values: T) => Tuple<T>) & {
|
|
|
175
175
|
};
|
|
176
176
|
//#endregion
|
|
177
177
|
export { isTypeable as a, Pipe as c, TypeableParams as i, Foldable as l, ExtractTag as n, Serializable as o, Typeable as r, SerializationMethods as s, Tuple as t, Type as u };
|
|
178
|
-
//# sourceMappingURL=Tuple-
|
|
178
|
+
//# sourceMappingURL=Tuple-C4maYbiO.d.ts.map
|
package/dist/branded/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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-BPeggBaO.js";
|
|
2
2
|
export { Brand, BrandedBoolean, BrandedNumber, BrandedString, ExtractBrand, Unwrap, createBrander, hasBrand, unwrapBrand as unwrap, unwrapBrand };
|
package/dist/cli/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{
|
|
3
|
-
`)},c=(
|
|
4
|
-
`).trimEnd()},l=()=>{let e=
|
|
5
|
-
`).trimEnd()},u=e=>JSON.stringify(e,null,2),d=()=>({version:r,categories:o,types:i}),f=e
|
|
2
|
+
import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{Et as e,q as t,vt as n}from"../src-JcsaR9MX.js";const r=`0.40.0`,i={Option:{description:`Safe nullable handling - Some<T> or None`,interfaces:[`Functor`,`Monad`,`Foldable`,`Extractable`,`Matchable`,`Serializable`,`Traversable`],methods:{create:[`Option(v)`,`Option.none()`,`Some(v)`,`None()`],transform:[`.map(f)`,`.flatMap(f)`,`.filter(p)`,`.ap(ff)`],extract:[`.fold(n, s)`,`.orElse(d)`,`.orThrow()`,`.orNull()`,`.match({Some, None})`],check:[`.isSome`,`.isNone`,`.isDefined`,`.isEmpty`]}},Either:{description:`Error handling with Left (error) or Right (success)`,interfaces:[`Functor`,`Monad`,`Foldable`,`Traversable`,`PromiseLike`],methods:{create:[`Right(v)`,`Left(e)`,`Either.right(v)`,`Either.left(e)`],transform:[`.map(f)`,`.flatMap(f)`,`.mapLeft(f)`,`.swap()`],extract:[`.fold(l, r)`,`.orElse(d)`,`.orThrow()`,`.match({Left, Right})`],check:[`.isRight`,`.isLeft`]}},Try:{description:`Wrap operations that may throw - Success<T> or Failure`,interfaces:[`Functor`,`Monad`,`Foldable`,`Extractable`,`Matchable`,`Serializable`,`Traversable`],methods:{create:[`Try(() => expr)`,`Success(v)`,`Failure(e)`],transform:[`.map(f)`,`.flatMap(f)`,`.recover(f)`,`.recoverWith(f)`],extract:[`.fold(f, s)`,`.orElse(d)`,`.orThrow()`,`.toOption()`,`.toEither()`],check:[`.isSuccess`,`.isFailure`]}},List:{description:`Immutable array with functional operations`,interfaces:[`Functor`,`Monad`,`Foldable`,`Collection`,`Serializable`,`Traversable`],methods:{create:[`List([...])`,`List.of(...)`,`List.empty()`],transform:[`.map(f)`,`.flatMap(f)`,`.filter(p)`,`.take(n)`,`.drop(n)`],extract:[`.fold(z, f)`,`.reduce(f)`,`.head`,`.tail`,`.toArray()`],check:[`.isEmpty`,`.nonEmpty`,`.size`,`.contains(v)`]}},Set:{description:`Immutable set of unique values`,interfaces:[`Functor`,`Foldable`,`Collection`,`Serializable`,`Traversable`],methods:{create:[`Set([...])`,`Set.of(...)`,`Set.empty()`],transform:[`.map(f)`,`.filter(p)`,`.union(s)`,`.intersection(s)`,`.difference(s)`],extract:[`.fold(z, f)`,`.toArray()`],check:[`.has(v)`,`.isEmpty`,`.size`]}},Map:{description:`Immutable key-value store`,interfaces:[`SafeTraversable`,`Collection`,`Serializable`],methods:{create:[`Map([...])`,`Map.of(...)`,`Map.empty()`],transform:[`.set(k, v)`,`.delete(k)`,`.map(f)`,`.filter(p)`],extract:[`.get(k)`,`.keys()`,`.values()`,`.entries()`,`.fold(z, f)`],check:[`.has(k)`,`.isEmpty`,`.size`]}},Lazy:{description:`Deferred computation with memoization`,interfaces:[`Functor`,`Monad`,`Foldable`,`Extractable`,`Serializable`,`Traversable`],methods:{create:[`Lazy(() => expr)`],transform:[`.map(f)`,`.flatMap(f)`],extract:[`.fold(n, s)`,`.orElse(d)`,`.orThrow()`,`.get()`],check:[`.isEvaluated`]}},LazyList:{description:`Lazy sequences for large/infinite data`,interfaces:[`Functor`,`Monad`,`Iterable`],methods:{create:[`LazyList.from(iter)`,`LazyList.range(start, end)`,`LazyList.infinite(f)`],transform:[`.map(f)`,`.filter(p)`,`.take(n)`,`.drop(n)`,`.concat(ll)`],extract:[`.head`,`.tail`,`.toArray()`],check:[`.isEmpty`]}},Task:{description:`Async operations with cancellation and progress`,interfaces:[],methods:{create:[`Task.of(v)`,`Task.from(promise)`,`Task.sync(f)`,`Task.async(f)`],transform:[`.map(f)`,`.flatMap(f)`,`.mapError(f)`],extract:[`.run()`,`.cancel()`],other:[`.onProgress(cb)`,`.onCancel(cb)`]}},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)`],transform:[`.map(f)`,`.flatMap(f)`,`.tap(f)`,`.mapError(f)`,`.recover(v)`,`.recoverWith(f)`],extract:[`.run()`,`.runSync()`,`.runEither()`,`.runExit()`,`.runOption()`,`.runTry()`,`.fold(onErr, onOk)`,`.match({failure, success})`],check:[],other:[`.catchTag(tag, f)`,`.catchAll(f)`,`.retry(n)`,`.retryWithDelay(n, ms)`,`.timeout(ms)`,`.delay(ms)`,`.zip(io)`,`.pipe(f)`,`IO.all([...])`,`IO.race([...])`,`IO.bracket(acquire, use, release)`,`IO.gen(function*() {...})`,`IO.Do.bind().map()`,`IO.service(Tag)`,`.provideService(Tag, impl)`,`.provideLayer(layer)`]}},FPromise:{description:`Enhanced Promise with functional methods`,interfaces:[`PromiseLike`],methods:{create:[`FPromise.of(v)`,`FPromise.from(promise)`],transform:[`.map(f)`,`.flatMap(f)`,`.mapError(f)`,`.recover(f)`],extract:[`.toPromise()`,`.cancel()`]}},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()`]}},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:[`Typeable`,`Valuable`,`Iterable`],methods:{create:[`Tuple([a, b, ...])`,`Tuple.of(a, b, ...)`],extract:[`.first`,`.second`,`.toArray()`],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`]}}},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`,`.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`],Collection:[`List`,`Set`,`Map`,`LazyList`,`Tuple`,`Stack`],Effect:[`IO`,`Task`,`FPromise`],Utility:[`Lazy`,`Cond`,`Match`,`Brand`,`ValidatedBrand`]},s=()=>{let t=n([`functype ${r} - Scala-inspired FP for TypeScript`,``]);return n(Object.entries(o)).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
|
+
`)},c=(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()},l=()=>{let e=n([`INTERFACES`,``]);return n(Object.entries(a)).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()},u=e=>JSON.stringify(e,null,2),d=()=>({version:r,categories:o,types:i}),f=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(),p=()=>Object.keys(i),m=()=>a,h={Option:`export interface Option<T extends Type> extends Functype<T, "Some" | "None">, Promisable<T>, Doable<T>, Reshapeable<T> {
|
|
6
6
|
/** The contained value (undefined for None) */
|
|
7
7
|
readonly value: T | undefined
|
|
8
8
|
/** Whether this Option contains no value */
|
|
@@ -634,7 +634,7 @@ import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{L as e,ct as t,
|
|
|
634
634
|
* @returns The result of applying the matching handler function
|
|
635
635
|
*/
|
|
636
636
|
match<R>(patterns: { Empty: () => R; NonEmpty: (values: A[]) => R }): R
|
|
637
|
-
} & Traversable<A> &`},g=e=>{let n
|
|
637
|
+
} & Traversable<A> &`},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(h[t]).or(n(Object.entries(h)).find(([e])=>e.toLowerCase()===t.toLowerCase()).map(([,e])=>e)),v=()=>{let e=n([`FULL INTERFACE DEFINITIONS`,`=`.repeat(60),``]);return n(Object.entries(h)).foldLeft(e)((e,[t,r])=>e.concat(n([`// ${t}`,r,``,`-`.repeat(60),``]))).toArray().join(`
|
|
638
638
|
`).trimEnd()},y=()=>{console.log(`functype - API documentation for LLMs
|
|
639
639
|
|
|
640
640
|
USAGE
|
|
@@ -656,5 +656,5 @@ EXAMPLES
|
|
|
656
656
|
npx functype Option --json # Option as JSON
|
|
657
657
|
npx functype Option --full # Full TypeScript interface
|
|
658
658
|
npx functype --full # All full interfaces (large output!)
|
|
659
|
-
`)},b=e=>{console.error(`Unknown type: ${e}`),console.error(``),console.error(`Available types: ${p().join(`, `)}`),console.error(``),console.error(`Use: npx functype interfaces - for interface reference`),process.exit(1)},x=e=>console.log(e),S=(
|
|
659
|
+
`)},b=e=>{console.error(`Unknown type: ${e}`),console.error(``),console.error(`Available types: ${p().join(`, `)}`),console.error(``),console.error(`Use: npx functype interfaces - for interface reference`),process.exit(1)},x=e=>console.log(e),S=(t,n)=>e(f(t)).fold(()=>b(t),e=>{n.full?_(e.name).fold(()=>x(n.json?u({[e.name]:e.data}):c(e.name,e.data)),t=>x(n.json?u({[e.name]:{...e.data,fullInterface:t}}):t)):x(n.json?u({[e.name]:e.data}):c(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?u(h):v()):x(e.json?u(d()):s())).when(()=>n.headOption.contains(`interfaces`),()=>x(e.json?u(m()):l())).default(()=>n.headOption.fold(()=>x(e.json?u(d()):s()),t=>S(t,e)))})();
|
|
660
660
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["pkg.version","TYPES: Record<string, TypeData>","INTERFACES: Record<string, InterfaceData>","FULL_INTERFACES: Record<string, string>"],"sources":["../../package.json","../../src/cli/data.ts","../../src/cli/formatters.ts","../../src/cli/full-interfaces.ts","../../src/cli/index.ts"],"sourcesContent":["{\n \"name\": \"functype\",\n \"version\": \"0.20.2\",\n \"type\": \"module\",\n \"description\": \"A functional programming library for TypeScript, using immutable data structures and type classes\",\n \"author\": \"jordan.burke@gmail.com\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/jordanburke/functype.git\"\n },\n \"homepage\": \"https://functype.org/\",\n \"url\": \"https://github.com/jordanburke/functype\",\n \"scripts\": {\n \"validate\": \"pnpm validate:core && pnpm validate:landing\",\n \"validate:core\": \"pnpm format && pnpm lint && pnpm test && pnpm docs:validate && pnpm build\",\n \"validate:landing\": \"cd landing && pnpm validate\",\n \"format\": \"prettier --write .\",\n \"format:check\": \"prettier --check .\",\n \"lint\": \"eslint ./src --fix\",\n \"lint:check\": \"eslint ./src\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage\",\n \"test:ui\": \"vitest --ui\",\n \"build\": \"rimraf dist && pnpm extract:interfaces && cross-env NODE_ENV=production tsdown\",\n \"extract:interfaces\": \"tsx scripts/extract-interfaces.ts\",\n \"build:watch\": \"tsdown --watch\",\n \"dev\": \"tsdown --watch\",\n \"compile\": \"tsc --noEmit\",\n \"clean\": \"rimraf dist\",\n \"prepublishOnly\": \"pnpm validate\",\n \"bench\": \"vitest bench\",\n \"bench:ui\": \"vitest bench --ui\",\n \"docs:preprocess\": \"tsx scripts/preprocess-docs.ts\",\n \"docs\": \"pnpm docs:preprocess && typedoc\",\n \"docs:watch\": \"typedoc --watch\",\n \"docs:sync\": \"tsx scripts/sync-docs.ts\",\n \"docs:validate\": \"tsx scripts/validate-docs.ts && tsx scripts/sync-docs.ts\",\n \"analyze:size\": \"pnpm build && node ./scripts/analyze-bundle-size.js\",\n \"landing:dev\": \"cd landing && pnpm dev\",\n \"landing:build\": \"cd landing && pnpm build\",\n \"landing:preview\": \"cd landing && pnpm preview\",\n \"cli-example\": \"npx . Option\"\n },\n \"devDependencies\": {\n \"@eslint/compat\": \"^1.4.1\",\n \"@semantic-release/commit-analyzer\": \"^13.0.1\",\n \"@semantic-release/github\": \"^11.0.6\",\n \"@semantic-release/npm\": \"^12.0.2\",\n \"@semantic-release/release-notes-generator\": \"^14.1.0\",\n \"@types/node\": \"^22.19.1\",\n \"eslint-config-functype\": \"1.3.0\",\n \"eslint-plugin-functional\": \"^9.0.2\",\n \"fast-check\": \"^4.3.0\",\n \"globals\": \"^16.5.0\",\n \"semantic-release\": \"^24.2.9\",\n \"tsdown\": \"^0.16.8\",\n \"tsx\": \"^4.21.0\",\n \"typedoc\": \"^0.28.15\",\n \"ts-builds\": \"^1.0.0\"\n },\n \"types\": \"./dist/index.d.ts\",\n \"module\": \"./dist/index.js\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"./option\": {\n \"import\": {\n \"types\": \"./dist/option/index.d.ts\",\n \"default\": \"./dist/option/index.js\"\n }\n },\n \"./either\": {\n \"import\": {\n \"types\": \"./dist/either/index.d.ts\",\n \"default\": \"./dist/either/index.js\"\n }\n },\n \"./try\": {\n \"import\": {\n \"types\": \"./dist/try/index.d.ts\",\n \"default\": \"./dist/try/index.js\"\n }\n },\n \"./list\": {\n \"import\": {\n \"types\": \"./dist/list/index.d.ts\",\n \"default\": \"./dist/list/index.js\"\n }\n },\n \"./conditional\": {\n \"import\": {\n \"types\": \"./dist/conditional/index.d.ts\",\n \"default\": \"./dist/conditional/index.js\"\n }\n },\n \"./do\": {\n \"import\": {\n \"types\": \"./dist/do/index.d.ts\",\n \"default\": \"./dist/do/index.js\"\n }\n },\n \"./lazy\": {\n \"import\": {\n \"types\": \"./dist/lazy/index.d.ts\",\n \"default\": \"./dist/lazy/index.js\"\n }\n },\n \"./task\": {\n \"import\": {\n \"types\": \"./dist/core/task/index.d.ts\",\n \"default\": \"./dist/core/task/index.js\"\n }\n },\n \"./fpromise\": {\n \"import\": {\n \"types\": \"./dist/fpromise/index.d.ts\",\n \"default\": \"./dist/fpromise/index.js\"\n }\n },\n \"./functype\": {\n \"import\": {\n \"types\": \"./dist/functype/index.d.ts\",\n \"default\": \"./dist/functype/index.js\"\n }\n },\n \"./typeclass\": {\n \"import\": {\n \"types\": \"./dist/typeclass/index.d.ts\",\n \"default\": \"./dist/typeclass/index.js\"\n }\n },\n \"./map\": {\n \"import\": {\n \"types\": \"./dist/map/index.d.ts\",\n \"default\": \"./dist/map/index.js\"\n }\n },\n \"./set\": {\n \"import\": {\n \"types\": \"./dist/set/index.d.ts\",\n \"default\": \"./dist/set/index.js\"\n }\n },\n \"./tuple\": {\n \"import\": {\n \"types\": \"./dist/tuple/index.d.ts\",\n \"default\": \"./dist/tuple/index.js\"\n }\n },\n \"./branded\": {\n \"import\": {\n \"types\": \"./dist/branded/index.d.ts\",\n \"default\": \"./dist/branded/index.js\"\n }\n },\n \"./companion\": {\n \"import\": {\n \"types\": \"./dist/companion/index.d.ts\",\n \"default\": \"./dist/companion/index.js\"\n }\n },\n \"./serialization\": {\n \"import\": {\n \"types\": \"./dist/serialization/index.d.ts\",\n \"default\": \"./dist/serialization/index.js\"\n }\n }\n },\n \"bin\": {\n \"functype\": \"./dist/cli/index.js\"\n },\n \"files\": [\n \"dist\"\n ],\n \"dependencies\": {\n \"safe-stable-stringify\": \"^2.5.0\"\n },\n \"sideEffects\": false,\n \"packageManager\": \"pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a\"\n}\n","/**\n * Curated API data for CLI output, optimized for LLM consumption\n */\n\nimport pkg from \"../../package.json\"\n\nexport const VERSION = pkg.version\n\nexport interface TypeData {\n description: string\n interfaces: string[]\n methods: {\n create?: string[]\n transform?: string[]\n extract?: string[]\n check?: string[]\n other?: string[]\n }\n}\n\nexport interface InterfaceData {\n extends?: string\n description: string\n methods: string[]\n}\n\nexport const TYPES: Record<string, TypeData> = {\n Option: {\n description: \"Safe nullable handling - Some<T> or None\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Extractable\", \"Matchable\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Option(v)\", \"Option.none()\", \"Some(v)\", \"None()\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".filter(p)\", \".ap(ff)\"],\n extract: [\".fold(n, s)\", \".orElse(d)\", \".orThrow()\", \".orNull()\", \".match({Some, None})\"],\n check: [\".isSome\", \".isNone\", \".isDefined\", \".isEmpty\"],\n },\n },\n\n Either: {\n description: \"Error handling with Left (error) or Right (success)\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Traversable\", \"PromiseLike\"],\n methods: {\n create: [\"Right(v)\", \"Left(e)\", \"Either.right(v)\", \"Either.left(e)\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".mapLeft(f)\", \".swap()\"],\n extract: [\".fold(l, r)\", \".orElse(d)\", \".orThrow()\", \".match({Left, Right})\"],\n check: [\".isRight\", \".isLeft\"],\n },\n },\n\n Try: {\n description: \"Wrap operations that may throw - Success<T> or Failure\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Extractable\", \"Matchable\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Try(() => expr)\", \"Success(v)\", \"Failure(e)\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".recover(f)\", \".recoverWith(f)\"],\n extract: [\".fold(f, s)\", \".orElse(d)\", \".orThrow()\", \".toOption()\", \".toEither()\"],\n check: [\".isSuccess\", \".isFailure\"],\n },\n },\n\n List: {\n description: \"Immutable array with functional operations\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Collection\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"List([...])\", \"List.of(...)\", \"List.empty()\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".filter(p)\", \".take(n)\", \".drop(n)\"],\n extract: [\".fold(z, f)\", \".reduce(f)\", \".head\", \".tail\", \".toArray()\"],\n check: [\".isEmpty\", \".nonEmpty\", \".size\", \".contains(v)\"],\n },\n },\n\n Set: {\n description: \"Immutable set of unique values\",\n interfaces: [\"Functor\", \"Foldable\", \"Collection\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Set([...])\", \"Set.of(...)\", \"Set.empty()\"],\n transform: [\".map(f)\", \".filter(p)\", \".union(s)\", \".intersection(s)\", \".difference(s)\"],\n extract: [\".fold(z, f)\", \".toArray()\"],\n check: [\".has(v)\", \".isEmpty\", \".size\"],\n },\n },\n\n Map: {\n description: \"Immutable key-value store\",\n interfaces: [\"SafeTraversable\", \"Collection\", \"Serializable\"],\n methods: {\n create: [\"Map([...])\", \"Map.of(...)\", \"Map.empty()\"],\n transform: [\".set(k, v)\", \".delete(k)\", \".map(f)\", \".filter(p)\"],\n extract: [\".get(k)\", \".keys()\", \".values()\", \".entries()\", \".fold(z, f)\"],\n check: [\".has(k)\", \".isEmpty\", \".size\"],\n },\n },\n\n Lazy: {\n description: \"Deferred computation with memoization\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Extractable\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Lazy(() => expr)\"],\n transform: [\".map(f)\", \".flatMap(f)\"],\n extract: [\".fold(n, s)\", \".orElse(d)\", \".orThrow()\", \".get()\"],\n check: [\".isEvaluated\"],\n },\n },\n\n LazyList: {\n description: \"Lazy sequences for large/infinite data\",\n interfaces: [\"Functor\", \"Monad\", \"Iterable\"],\n methods: {\n create: [\"LazyList.from(iter)\", \"LazyList.range(start, end)\", \"LazyList.infinite(f)\"],\n transform: [\".map(f)\", \".filter(p)\", \".take(n)\", \".drop(n)\", \".concat(ll)\"],\n extract: [\".head\", \".tail\", \".toArray()\"],\n check: [\".isEmpty\"],\n },\n },\n\n Task: {\n description: \"Async operations with cancellation and progress\",\n interfaces: [],\n methods: {\n create: [\"Task.of(v)\", \"Task.from(promise)\", \"Task.sync(f)\", \"Task.async(f)\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".mapError(f)\"],\n extract: [\".run()\", \".cancel()\"],\n other: [\".onProgress(cb)\", \".onCancel(cb)\"],\n },\n },\n\n FPromise: {\n description: \"Enhanced Promise with functional methods\",\n interfaces: [\"PromiseLike\"],\n methods: {\n create: [\"FPromise.of(v)\", \"FPromise.from(promise)\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".mapError(f)\", \".recover(f)\"],\n extract: [\".toPromise()\", \".cancel()\"],\n },\n },\n\n Cond: {\n description: \"Conditional expression builder - replace if-else chains\",\n interfaces: [],\n methods: {\n create: [\"Cond<T>()\"],\n other: [\".case(pred, result)\", \".otherwise(result)\", \".eval()\"],\n },\n },\n\n Match: {\n description: \"Pattern matching - replace switch statements\",\n interfaces: [],\n methods: {\n create: [\"Match(value)\"],\n other: [\".case(pattern, result)\", \".when(pred, result)\", \".default(result)\", \".done()\"],\n },\n },\n\n Brand: {\n description: \"Nominal typing without runtime overhead\",\n interfaces: [],\n methods: {\n create: [\"Brand<K, T>(value)\"],\n extract: [\".unwrap()\", \".toString()\"],\n },\n },\n\n ValidatedBrand: {\n description: \"Branded types with runtime validation\",\n interfaces: [],\n methods: {\n create: [\"ValidatedBrand(validator)\", \".of(v)\", \".from(v)\", \".unsafeOf(v)\"],\n check: [\".is(v)\"],\n other: [\".refine(validator)\"],\n },\n },\n\n Tuple: {\n description: \"Fixed-size typed array\",\n interfaces: [\"Typeable\", \"Valuable\", \"Iterable\"],\n methods: {\n create: [\"Tuple([a, b, ...])\", \"Tuple.of(a, b, ...)\"],\n extract: [\".first\", \".second\", \".toArray()\"],\n transform: [\".map(f)\"],\n },\n },\n\n Stack: {\n description: \"Immutable LIFO stack\",\n interfaces: [\"Foldable\", \"Collection\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Stack()\", \"Stack.of(...)\"],\n transform: [\".push(v)\", \".pop()\"],\n extract: [\".peek()\", \".toArray()\"],\n check: [\".isEmpty\", \".size\"],\n },\n },\n}\n\nexport const INTERFACES: Record<string, InterfaceData> = {\n Functor: {\n description: \"Transform contained values\",\n methods: [\".map<B>(f: A => B): Functor<B>\"],\n },\n\n Applicative: {\n extends: \"Functor\",\n description: \"Apply wrapped functions\",\n methods: [\".ap<B>(ff: Applicative<A => B>): Applicative<B>\"],\n },\n\n Monad: {\n extends: \"Applicative\",\n description: \"Chain operations returning wrapped values\",\n methods: [\".flatMap<B>(f: A => Monad<B>): Monad<B>\"],\n },\n\n Foldable: {\n description: \"Extract via pattern matching\",\n methods: [\n \".fold<B>(empty: () => B, f: A => B): B\",\n \".foldLeft<B>(z: B, op: (B, A) => B): B\",\n \".foldRight<B>(z: B, op: (A, B) => B): B\",\n ],\n },\n\n Extractable: {\n description: \"Get contained value with fallback\",\n methods: [\".orElse(d: T): T\", \".orThrow(e?: Error): T\", \".orNull(): T | null\", \".orUndefined(): T | undefined\"],\n },\n\n Matchable: {\n description: \"Pattern match on type variants\",\n methods: [\".match<R>(patterns: Record<Tag, Handler>): R\"],\n },\n\n Traversable: {\n description: \"Iterate and check contents\",\n methods: [\".size: number\", \".isEmpty: boolean\", \".contains(v: A): boolean\", \".reduce<B>(f, init): B\"],\n },\n\n Collection: {\n description: \"Collection operations\",\n methods: [\".toArray(): A[]\", \".forEach(f: A => void): void\"],\n },\n\n Serializable: {\n description: \"Convert to string formats\",\n methods: [\".serialize().toJSON(): string\", \".serialize().toYAML(): string\"],\n },\n}\n\nexport const CATEGORIES = {\n Core: [\"Option\", \"Either\", \"Try\"],\n Collection: [\"List\", \"Set\", \"Map\", \"LazyList\", \"Tuple\", \"Stack\"],\n Async: [\"Task\", \"FPromise\"],\n Utility: [\"Lazy\", \"Cond\", \"Match\", \"Brand\", \"ValidatedBrand\"],\n}\n","/**\n * Output formatters for CLI - markdown and JSON\n * Uses functype FP patterns for implementation\n */\n\nimport { List } from \"../list\"\nimport { Option } from \"../option\"\nimport type { InterfaceData, TypeData } from \"./data\"\nimport { CATEGORIES, INTERFACES, TYPES, VERSION } from \"./data\"\n\n/**\n * Format the library overview (default command)\n */\nexport const formatOverview = (): string => {\n const header = List<string>([`functype ${VERSION} - Scala-inspired FP for TypeScript`, \"\"])\n\n const categoryLines = List(Object.entries(CATEGORIES)).foldLeft(header)((acc, [category, typeNames]) => {\n const withCategory = acc.add(category.toUpperCase())\n const withTypes = List(typeNames).foldLeft(withCategory)((innerAcc, name) =>\n Option(TYPES[name]).fold(\n () => innerAcc,\n (type) => {\n const ifaces = type.interfaces.length > 0 ? ` [${type.interfaces.join(\", \")}]` : \"\"\n return innerAcc.add(` ${name}${ifaces}`).add(` ${type.description}`)\n },\n ),\n )\n return withTypes.add(\"\")\n })\n\n return categoryLines\n .concat(List([\"Use: npx functype <Type> for details\", \"Use: npx functype interfaces for interface reference\"]))\n .toArray()\n .join(\"\\n\")\n}\n\n/**\n * Format detailed type documentation\n */\nexport const formatType = (name: string, data: TypeData): string => {\n const ifaceList = data.interfaces.length > 0 ? ` [${data.interfaces.join(\", \")}]` : \"\"\n const categoryOrder = List([\"create\", \"transform\", \"extract\", \"check\", \"other\"] as const)\n const header = List<string>([`${name}<T>${ifaceList}`, \"\", data.description, \"\"])\n\n const lines = categoryOrder.foldLeft(header)((acc, cat) =>\n Option(data.methods[cat])\n .filter((methods) => methods.length > 0)\n .fold(\n () => acc,\n (methods) => {\n const withCat = acc.add(cat.toUpperCase())\n const withMethods = List(methods).foldLeft(withCat)((innerAcc, method) => innerAcc.add(` ${method}`))\n return withMethods.add(\"\")\n },\n ),\n )\n\n return lines.toArray().join(\"\\n\").trimEnd()\n}\n\n/**\n * Format interface reference\n */\nexport const formatInterfaces = (): string => {\n const header = List<string>([\"INTERFACES\", \"\"])\n\n const lines = List(Object.entries(INTERFACES)).foldLeft(header)((acc, [name, data]) => {\n const ext = data.extends ? ` extends ${data.extends}` : \"\"\n const withHeader = acc.add(`${name}<A>${ext}`).add(` ${data.description}`)\n const withMethods = List(data.methods).foldLeft(withHeader)((innerAcc, method) => innerAcc.add(` ${method}`))\n return withMethods.add(\"\")\n })\n\n return lines.toArray().join(\"\\n\").trimEnd()\n}\n\n/**\n * Format as JSON\n */\nexport const formatJson = (data: unknown): string => JSON.stringify(data, null, 2)\n\n/**\n * Get overview data for JSON output\n */\nexport const getOverviewData = (): {\n version: string\n categories: Record<string, string[]>\n types: Record<string, TypeData>\n} => ({\n version: VERSION,\n categories: CATEGORIES,\n types: TYPES,\n})\n\n/**\n * Get type data by name (case-insensitive)\n */\nexport const getType = (name: string): { name: string; data: TypeData } | undefined =>\n Option(TYPES[name])\n .map((data) => ({ name, data }))\n .or(\n List(Object.entries(TYPES))\n .find(([typeName]) => typeName.toLowerCase() === name.toLowerCase())\n .map(([typeName, typeData]) => ({ name: typeName, data: typeData })),\n )\n .orUndefined()\n\n/**\n * Get all type names for error messages\n */\nexport const getAllTypeNames = (): string[] => Object.keys(TYPES)\n\n/**\n * Get interfaces data for JSON output\n */\nexport const getInterfacesData = (): Record<string, InterfaceData> => INTERFACES\n","/**\n * Auto-generated full interface definitions.\n * Generated by scripts/extract-interfaces.ts\n * DO NOT EDIT MANUALLY\n */\n\nexport const FULL_INTERFACES: Record<string, string> = {\n Option: `export interface Option<T extends Type> extends Functype<T, \"Some\" | \"None\">, Promisable<T>, Doable<T>, Reshapeable<T> {\n /** The contained value (undefined for None) */\n readonly value: T | undefined\n /** Whether this Option contains no value */\n isEmpty: boolean\n /**\n * Returns true if this Option is a Some (contains a value)\n * @returns true if this Option contains a value, false otherwise\n */\n isSome(): this is Option<T> & { value: T; isEmpty: false }\n /**\n * Returns true if this Option is a None (contains no value)\n * @returns true if this Option is empty, false otherwise\n */\n isNone(): this is Option<T> & { value: undefined; isEmpty: true }\n /**\n * Returns the contained value or a default value if None\n * @param defaultValue - The value to return if this Option is None\n * @returns The contained value or defaultValue\n */\n orElse(defaultValue: T): T\n /**\n * Returns the contained value or throws an error if None\n * @param error - Optional custom error to throw. If not provided, throws a default error\n * @returns The contained value\n * @throws The specified error or a default error if the Option is None\n */\n orThrow(error?: Error): T\n /**\n * Returns this Option if it contains a value, otherwise returns the alternative container\n * @param alternative - The alternative Option to return if this is None\n * @returns This Option or the alternative\n */\n or(alternative: Option<T>): Option<T>\n /**\n * Returns the contained value or null if None\n * @returns The contained value or null\n */\n orNull(): T | null\n /**\n * Returns the contained value or undefined if None\n * @returns The contained value or undefined\n */\n orUndefined(): T | undefined\n /**\n * Maps the value inside the Option using the provided function\n * @param f - The mapping function\n * @returns A new Option containing the mapped value, or None if this Option is None\n */\n map<U extends Type>(f: (value: T) => U): Option<U>\n /**\n * Applies a wrapped function to a wrapped value (Applicative pattern)\n * @param ff - An Option containing a function from T to U\n * @returns A new Option containing the result of applying the function\n */\n ap<U extends Type>(ff: Option<(value: T) => U>): Option<U>\n /**\n * Returns this Option if it contains a value that satisfies the predicate, otherwise returns None\n * @param predicate - The predicate function to test the value\n * @returns This Option or None\n */\n filter(predicate: (value: T) => boolean): Option<T>\n /**\n * Maps the value using a function that returns an Option\n * @param f - The mapping function returning an Option\n * @returns The result of applying f to the contained value, or None if this Option is None\n */\n flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>\n /**\n * Maps the value using an async function that returns an Option\n * @param f - The async mapping function returning an Option\n * @returns Promise of the result of applying f to the contained value, or None if this Option is None\n */\n flatMapAsync<U extends Type>(f: (value: T) => Promise<Option<U>>): Promise<Option<U>>\n /**\n * Applies a binary operator to a start value and the contained value\n * @param f - The binary operator\n * @returns The result of the reduction\n */\n reduce<U>(f: (acc: U, value: T) => U): U\n /**\n * Applies a binary operator to the contained value and a start value\n * @param f - The binary operator\n * @returns The result of the reduction\n */\n reduceRight<U>(f: (acc: U, value: T) => U): U\n /**\n * Pattern matches over the Option, applying onNone if None and onSome if Some\n * @param onNone - Function to apply if the Option is None\n * @param onSome - Function to apply if the Option has a value\n * @returns The result of applying the appropriate function\n */\n fold<U>(onNone: () => U, onSome: (value: T) => U): U\n /**\n * Left-associative fold using the provided zero value and operation\n * @param z - Zero/identity value\n * @returns A function that takes an operation to apply\n */\n foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B\n /**\n * Right-associative fold using the provided zero value and operation\n * @param z - Zero/identity value\n * @returns A function that takes an operation to apply\n */\n foldRight<B>(z: B): (op: (a: T, b: B) => B) => B\n /**\n * Converts this Option to a List\n * @returns A List containing the value if Some, or empty List if None\n */\n toList(): List<T>\n /**\n * Checks if this Option contains the specified value\n * @param value - The value to check for\n * @returns true if this Option contains the value, false otherwise\n */\n contains(value: T): boolean\n /** The number of elements in this Option (0 or 1) */\n size: number\n /**\n * Converts this Option to an Either\n * @param left - The value to use for Left if this Option is None\n * @returns Either.Right with the contained value if Some, or Either.Left with left if None\n */\n toEither<E>(left: E): Either<E, T>\n /**\n * Returns a string representation of this Option\n * @returns A string representation\n */\n toString(): string\n /**\n * Returns a simple object representation of this Option\n * @returns An object with _tag and value properties\n */\n toValue(): { _tag: \"Some\" | \"None\"; value: T }\n /**\n * Pattern matches over the Option, applying a handler function based on the variant\n * @param patterns - Object with handler functions for Some and None variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Some: (value: T) => R; None: () => R }): R\n}`,\n\n Either: `export interface Either<L extends Type, R extends Type>\n extends FunctypeBase<R, \"Left\" | \"Right\">, Promisable<R>, Doable<R>, Reshapeable<R>, Extractable<R> {\n readonly _tag: \"Left\" | \"Right\"\n value: L | R\n isLeft(): this is Either<L, R> & { readonly _tag: \"Left\"; value: L }\n isRight(): this is Either<L, R> & { readonly _tag: \"Right\"; value: R }\n orElse: (defaultValue: R) => R\n orThrow: (error?: Error) => R\n or(alternative: Either<L, R>): Either<L, R>\n orNull: () => R | null\n orUndefined: () => R | undefined\n readonly map: <U extends Type>(f: (value: R) => U) => Either<L, U>\n ap: <U extends Type>(ff: Either<L, (value: R) => U>) => Either<L, U>\n merge: <L1 extends Type, R1 extends Type>(other: Either<L1, R1>) => Either<L | L1, [R, R1]>\n mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>\n flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>\n flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>\n toOption: () => Option<R>\n toList: () => List<R>\n toString: () => string\n [Symbol.iterator]: () => Iterator<R>\n yield: () => Generator<R, void, unknown>\n traverse: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U[]>\n lazyMap: <U extends Type>(f: (value: R) => U) => Generator<Either<L, U>, void, unknown>\n tap: (f: (value: R) => void) => Either<L, R>\n tapLeft: (f: (value: L) => void) => Either<L, R>\n mapLeft: <L2 extends Type>(f: (value: L) => L2) => Either<L2, R>\n bimap: <L2 extends Type, R2 extends Type>(fl: (value: L) => L2, fr: (value: R) => R2) => Either<L2, R2>\n fold: <T extends Type>(onLeft: (value: L) => T, onRight: (value: R) => T) => T\n swap: () => Either<R, L>\n /**\n * Pipes the value through the provided function based on whether this is a Left or Right\n * @param onLeft - The function to apply if this is a Left\n * @param onRight - The function to apply if this is a Right\n * @returns The result of applying the appropriate function\n */\n pipeEither<U extends Type>(onLeft: (value: L) => U, onRight: (value: R) => U): U\n\n /**\n * Pipes the Either value through the provided function\n * @param f - The function to apply to the value (Left or Right)\n * @returns The result of applying the function to the value\n */\n pipe<U extends Type>(f: (value: L | R) => U): U\n /**\n * Pattern matches over the Either, applying a handler function based on the variant\n * @param patterns - Object with handler functions for Left and Right variants\n * @returns The result of applying the matching handler function\n */\n match<T>(patterns: { Left: (value: L) => T; Right: (value: R) => T }): T\n /**\n * Returns the value and tag for inspection\n */\n toValue(): { _tag: \"Left\" | \"Right\"; value: L | R }\n /**\n * Custom JSON serialization that excludes getter properties\n */\n toJSON(): { _tag: \"Left\" | \"Right\"; value: L | R }\n}`,\n\n Try: `export interface Try<T>\n extends FunctypeBase<T, TypeNames>, Extractable<T>, Pipe<T>, Promisable<T>, Doable<T>, Reshapeable<T> {\n readonly _tag: TypeNames\n readonly error: Error | undefined\n isSuccess(): this is Try<T> & { readonly _tag: \"Success\"; error: undefined }\n isFailure(): this is Try<T> & { readonly _tag: \"Failure\"; error: Error }\n orElse: (defaultValue: T) => T\n orThrow: (error?: Error) => T\n or: (alternative: Try<T>) => Try<T>\n orNull: () => T | null\n orUndefined: () => T | undefined\n toOption: () => Option<T>\n toEither: <E extends Type>(leftValue: E) => Either<E, T>\n toList: () => List<T>\n toTry: () => Try<T>\n map: <U>(f: (value: T) => U) => Try<U>\n ap: <U>(ff: Try<(value: T) => U>) => Try<U>\n flatMap: <U>(f: (value: T) => Try<U>) => Try<U>\n flatMapAsync: <U>(f: (value: T) => Promise<Try<U>>) => Promise<Try<U>>\n /**\n * Pattern matches over the Try, applying onFailure if Failure and onSuccess if Success\n * @param onFailure - Function to apply if the Try is Failure\n * @param onSuccess - Function to apply if the Try is Success\n * @returns The result of applying the appropriate function\n */\n fold: <U extends Type>(onFailure: (error: Error) => U, onSuccess: (value: T) => U) => U\n toString: () => string\n /**\n * Pattern matches over the Try, applying a handler function based on the variant\n * @param patterns - Object with handler functions for Success and Failure variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Success: (value: T) => R; Failure: (error: Error) => R }): R\n toValue(): { _tag: TypeNames; value: T | Error }\n}`,\n\n List: `export interface List<A> extends FunctypeCollection<A, \"List\">, Doable<A>, Reshapeable<A> {\n readonly length: number\n readonly [Symbol.iterator]: () => Iterator<A>\n // Override these to return List instead of FunctypeCollection\n map: <B>(f: (a: A) => B) => List<B>\n ap: <B>(ff: List<(value: A) => B>) => List<B>\n flatMap: <B>(f: (a: A) => Iterable<B>) => List<B>\n flatMapAsync: <B>(f: (a: A) => PromiseLike<Iterable<B>>) => PromiseLike<List<B>>\n // Override filter for type guard support\n filter<S extends A>(predicate: (a: A) => a is S): List<S>\n filter(predicate: (a: A) => unknown): List<A>\n filterNot: (p: (a: A) => boolean) => List<A>\n // List-specific methods\n /** @internal */\n filterType: <T extends Typeable<string, unknown>>(tag: string) => List<T & A>\n remove: (value: A) => List<A>\n removeAt: (index: number) => List<A>\n add: (item: A) => List<A>\n get: (index: number) => Option<A>\n concat: (other: List<A>) => List<A>\n /**\n * Pattern matches over the List, applying a handler function based on whether it's empty\n * @param patterns - Object with handler functions for Empty and NonEmpty variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Empty: () => R; NonEmpty: (values: A[]) => R }): R\n}`,\n\n Set: `export interface Set<A> extends FunctypeCollection<A, \"Set\">, Collection<A> {\n add: (value: A) => Set<A>\n remove: (value: A) => Set<A>\n contains: (value: A) => boolean\n has: (value: A) => boolean\n map: <B>(f: (a: A) => B) => Set<B>\n flatMap: <B>(f: (a: A) => Iterable<B>) => Set<B>\n filter: (p: (a: A) => boolean) => Set<A>\n filterNot: (p: (a: A) => boolean) => Set<A>\n fold: <U extends Type>(onEmpty: () => U, onValue: (value: A) => U) => U\n toList: () => List<A>\n toSet: () => Set<A>\n toArray: <B = A>() => B[]\n toString: () => string\n}`,\n\n Map: `export interface Map<K, V>\n extends\n SafeTraversable<K, V>,\n Collection<Tuple<[K, V]>>,\n Typeable<\"Map\">,\n Serializable<[K, V][]>,\n Pipe<[K, V][]>,\n Foldable<Tuple<[K, V]>>,\n Iterable<[K, V]> {\n readonly _tag: \"Map\"\n add(item: Tuple<[K, V]>): Map<K, V>\n remove(value: K): Map<K, V>\n map<U>(f: (value: V) => U): Map<K, U>\n ap<U>(ff: Map<K, (value: V) => U>): Map<K, U>\n flatMap<K2, V2>(f: (entry: Tuple<[K, V]>) => Iterable<[K2, V2]>): Map<K2, V2>\n flatMapAsync<U>(f: (value: V) => PromiseLike<Map<K, U>>): PromiseLike<Map<K, U>>\n get(key: K): Option<V>\n getOrElse(key: K, defaultValue: V): V\n orElse(key: K, alternative: Option<V>): Option<V>\n fold<U extends Type>(onEmpty: () => U, onValue: (value: Tuple<[K, V]>) => U): U\n foldLeft<B>(z: B): (op: (b: B, a: Tuple<[K, V]>) => B) => B\n foldRight<B>(z: B): (op: (a: Tuple<[K, V]>, b: B) => B) => B\n /**\n * Pattern matches over the Map, applying a handler function based on whether it's empty\n * @param patterns - Object with handler functions for Empty and NonEmpty variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Empty: () => R; NonEmpty: (entries: Array<Tuple<[K, V]>>) => R }): R\n toValue(): { _tag: \"Map\"; value: [K, V][] }\n}`,\n\n Lazy: `export interface Lazy<T extends Type> extends FunctypeBase<T, \"Lazy\">, Extractable<T>, Pipe<T> {\n /** Tag identifying this as a Lazy type */\n readonly _tag: \"Lazy\"\n /** Whether the computation has been evaluated */\n readonly isEvaluated: boolean\n /**\n * Returns the computed value or a default value if computation fails\n * @param defaultValue - The value to return if computation fails\n * @returns The computed value or defaultValue\n */\n orElse(defaultValue: T): T\n /**\n * Returns the computed value or null if computation fails\n * @returns The computed value or null\n */\n orNull(): T | null\n /**\n * Returns the computed value or throws an error if computation fails\n * @param error - Optional custom error to throw. If not provided, throws the computation error or a default error\n * @returns The computed value\n * @throws The specified error, computation error, or a default error\n */\n orThrow(error?: Error): T\n /**\n * Returns this Lazy if computation succeeds, otherwise returns the alternative Lazy\n * @param alternative - The alternative Lazy to use if computation fails\n * @returns This Lazy or the alternative\n */\n or(alternative: Lazy<T>): Lazy<T>\n /**\n * Maps the value inside the Lazy using the provided function\n * @param f - The mapping function\n * @returns A new Lazy containing the mapped value\n */\n map<U extends Type>(f: (value: T) => U): Lazy<U>\n /**\n * Applies a wrapped function to a wrapped value (Applicative pattern)\n * @param ff - A Lazy containing a function from T to U\n * @returns A new Lazy containing the result\n */\n ap<U extends Type>(ff: Lazy<(value: T) => U>): Lazy<U>\n /**\n * Maps the value inside the Lazy using an async function\n * @param f - The async mapping function\n * @returns A Promise of a new Lazy containing the mapped value\n */\n mapAsync<U extends Type>(f: (value: T) => Promise<U>): Promise<Lazy<U>>\n /**\n * Maps the value using a function that returns a Lazy\n * @param f - The mapping function returning a Lazy\n * @returns A new Lazy containing the flattened result\n */\n flatMap<U extends Type>(f: (value: T) => Lazy<U>): Lazy<U>\n /**\n * Maps the value using an async function that returns a Lazy\n * @param f - The async mapping function returning a Lazy\n * @returns A Promise of a new Lazy containing the flattened result\n */\n flatMapAsync<U extends Type>(f: (value: T) => Promise<Lazy<U>>): Promise<Lazy<U>>\n /**\n * Returns a Lazy that filters the value based on a predicate\n * @param predicate - The predicate function\n * @returns A Lazy containing an Option of the value\n */\n filter(predicate: (value: T) => boolean): Lazy<Option<T>>\n /**\n * Recovers from a failed computation by providing an alternative value\n * @param f - Function that takes the error and returns a recovery value\n * @returns A new Lazy that will use the recovery function if computation fails\n */\n recover(f: (error: unknown) => T): Lazy<T>\n /**\n * Recovers from a failed computation by providing an alternative Lazy\n * @param f - Function that takes the error and returns a recovery Lazy\n * @returns A new Lazy that will use the recovery Lazy if computation fails\n */\n recoverWith(f: (error: unknown) => Lazy<T>): Lazy<T>\n /**\n * Evaluates the computation and returns it as an Option\n * @returns Some containing the value if successful, None if computation fails\n */\n toOption(): Option<T>\n /**\n * Evaluates the computation and returns it as an Either\n * @returns Right containing the value if successful, Left containing the error if computation fails\n */\n toEither(): Either<unknown, T>\n /**\n * Evaluates the computation and returns it as an Either with a mapped error\n * @param mapError - Function to map the error\n * @returns Right containing the value if successful, Left containing the mapped error if computation fails\n */\n toEitherWith<E>(mapError: (error: unknown) => E): Either<E, T>\n /**\n * Evaluates the computation and returns it as a Try\n * @returns Try containing the result of the computation\n */\n toTry(): Try<T>\n /**\n * Applies an effect function to the value if computation succeeds\n * @param f - The effect function\n * @returns This Lazy for chaining\n */\n tap(f: (value: T) => void): Lazy<T>\n /**\n * Applies an effect function to the error if computation fails\n * @param f - The effect function for errors\n * @returns This Lazy for chaining\n */\n tapError(f: (error: unknown) => void): Lazy<T>\n /**\n * Pattern matching on the Lazy value\n * @param f - Function to apply to the computed value\n * @returns The result of applying f to the computed value\n */\n fold<U>(f: (value: T) => U): U\n /**\n * Pattern matching with success and failure handlers\n * @param onFailure - Function to handle computation failure\n * @param onSuccess - Function to handle successful computation\n * @returns The result of the appropriate handler\n */\n foldWith<U>(onFailure: (error: unknown) => U, onSuccess: (value: T) => U): U\n /**\n * Left fold operation\n * @param z - Initial value\n * @returns Function that takes an operator and applies it\n */\n foldLeft: <B>(z: B) => (op: (b: B, a: T) => B) => B\n /**\n * Right fold operation\n * @param z - Initial value\n * @returns Function that takes an operator and applies it\n */\n foldRight: <B>(z: B) => (op: (a: T, b: B) => B) => B\n /**\n * Pattern matching for the Lazy type\n * @param patterns - Object with handler for Lazy pattern\n * @returns The result of the matched handler\n */\n match<R>(patterns: { Lazy: (value: T) => R }): R\n /**\n * Creates a string representation of the Lazy\n * @returns String representation showing evaluation status\n */\n toString(): string\n /**\n * Converts the Lazy to a value object\n * @returns Object representation of the Lazy with evaluation state\n */\n toValue(): { _tag: \"Lazy\"; evaluated: boolean; value?: T }\n}`,\n\n LazyList: `export interface LazyList<A extends Type>\n extends Foldable<A>, Pipe<LazyList<A>>, Serializable<LazyList<A>>, Typeable<\"LazyList\"> {\n // Iterator protocol\n [Symbol.iterator](): Iterator<A>\n\n // Lazy operations\n map<B extends Type>(f: (a: A) => B): LazyList<B>\n flatMap<B extends Type>(f: (a: A) => LazyList<B>): LazyList<B>\n filter(predicate: (a: A) => boolean): LazyList<A>\n take(n: number): LazyList<A>\n drop(n: number): LazyList<A>\n takeWhile(predicate: (a: A) => boolean): LazyList<A>\n dropWhile(predicate: (a: A) => boolean): LazyList<A>\n concat(other: LazyList<A>): LazyList<A>\n zip<B extends Type>(other: LazyList<B>): LazyList<[A, B]>\n\n // Terminal operations (force evaluation)\n toList(): List<A>\n toArray(): A[]\n forEach(f: (a: A) => void): void\n reduce<B extends Type>(f: (acc: B, a: A) => B, initial: B): B\n find(predicate: (a: A) => boolean): Option<A>\n some(predicate: (a: A) => boolean): boolean\n every(predicate: (a: A) => boolean): boolean\n count(): number\n first(): Option<A>\n last(): Option<A>\n\n // Additional methods for clarity\n toString(): string\n}`,\n\n TaskOutcome: `export interface TaskOutcome<T>\n extends FunctypeBase<T, \"Ok\" | \"Err\">, Extractable<T>, AsyncMonad<T>, Promisable<T>, Doable<T> {\n readonly _tag: \"Ok\" | \"Err\"\n readonly _meta: TaskMetadata\n\n // Value access\n readonly value?: T\n readonly error?: Throwable\n\n // Functional methods\n readonly map: <U>(f: (value: T) => U) => TaskOutcome<U>\n readonly flatMap: <U>(f: (value: T) => TaskOutcome<U> | Either<Throwable, U>) => TaskOutcome<U>\n readonly ap: <U>(ff: TaskOutcome<(value: T) => U>) => TaskOutcome<U>\n readonly mapAsync: <U>(f: (value: T) => Promise<U>) => Promise<TaskOutcome<U>>\n readonly flatMapAsync: <U>(f: (value: T) => Promise<TaskOutcome<U>>) => Promise<TaskOutcome<U>>\n\n // Error handling methods\n readonly mapError: (f: (error: Throwable) => Throwable) => TaskOutcome<T>\n readonly recover: (value: T) => Ok<T>\n readonly recoverWith: (f: (error: Throwable) => T) => Ok<T>\n\n // Type guards\n readonly isSuccess: () => this is Ok<T>\n readonly isFailure: () => this is Err<T>\n readonly isOk: () => this is Ok<T>\n readonly isErr: () => this is Err<T>\n\n // Conversion methods\n readonly toEither: () => Either<Throwable, T>\n readonly toTry: () => Try<T>\n readonly toOption: () => Option<T>\n readonly toList: () => List<T>\n\n // Pattern matching\n readonly fold: <U>(onErr: (error: Throwable) => U, onOk: (value: T) => U) => U\n readonly match: <U>(patterns: { Ok: (value: T) => U; Err: (error: Throwable) => U }) => U\n}`,\n\n FPromise: `export type FPromise<T extends Type, E extends Type = unknown> = PromiseLike<T> & {\n readonly _tag: \"FPromise\"\n\n // FPromise methods\n tap: (f: (value: T) => void) => FPromise<T, E>\n mapError: <E2>(f: (error: E, context: ErrorContext) => E2) => FPromise<T, E2>\n tapError: (f: (error: E) => void) => FPromise<T, E>\n recover: (fallback: T) => FPromise<T, never>\n recoverWith: (f: (error: E) => T) => FPromise<T, never>\n recoverWithF: <E2>(f: (error: E) => FPromise<T, E2>) => FPromise<T, E2>\n filterError: <E2 extends E>(\n predicate: (error: E) => boolean,\n handler: (error: E) => FPromise<T, E2>,\n ) => FPromise<T, E>\n logError: (logger: (error: E, context: ErrorContext) => void) => FPromise<T, E>\n toPromise: () => Promise<T>\n toEither: () => Promise<Either<E, T>>\n fold: <R extends Type>(onError: (error: E) => R, onSuccess: (value: T) => R) => FPromise<R, never>\n\n // Functor implementation\n map: <U extends Type>(f: (value: T) => U) => FPromise<U, E>\n\n // AsyncFunctor implementation\n flatMap: <U extends Type>(f: (value: T) => FPromise<U, E> | PromiseLike<U>) => FPromise<U, E>\n flatMapAsync: <U extends Type>(f: (value: T) => PromiseLike<U>) => Promise<U>\n}`,\n\n Tuple: `export interface Tuple<T extends Type[]>\n extends Foldable<T[number]>, Pipe<Tuple<T>>, Serializable<Tuple<T>>, Typeable<\"Tuple\"> {\n get<K extends number>(index: K): T[K]\n\n map<U extends Type[]>(f: (value: T) => U): Tuple<U>\n\n flatMap<U extends Type[]>(f: (value: T) => Tuple<U>): Tuple<U>\n\n toArray(): T\n\n length: number\n\n [Symbol.iterator](): Iterator<T[number]>\n\n toString(): string\n\n toValue(): { _tag: \"Tuple\"; value: T }\n}`,\n\n Stack: `export type Stack<A extends Type> = {\n /**\n * Push a value onto the top of the stack\n * @param value - The value to push\n * @returns A new Stack with the value added\n */\n push(value: A): Stack<A>\n\n /**\n * Remove and return the top value from the stack\n * @returns A tuple containing the new Stack and the value\n */\n pop(): [Stack<A>, Option<A>]\n\n /**\n * Return the top value without removing it\n * @returns The top value wrapped in an Option\n */\n peek(): Option<A>\n\n /**\n * Transforms each element in the stack using the provided function\n * @param f - The mapping function\n * @returns A new Stack with transformed elements\n */\n map<B extends Type>(f: (a: A) => B): Stack<B>\n\n /**\n * Maps each element to a Stack and flattens the result\n * @param f - The mapping function returning a Stack\n * @returns A new flattened Stack\n */\n flatMap<B extends Type>(f: (a: A) => Stack<B>): Stack<B>\n\n /**\n * Applies a Stack of functions to this Stack\n * @param ff - Stack of functions to apply\n * @returns A new Stack with applied functions\n */\n ap<B extends Type>(ff: Stack<(value: A) => B>): Stack<B>\n\n /**\n * Maps each element to an async Stack and flattens the result\n * @param f - The async mapping function returning a Stack\n * @returns A promise of the new flattened Stack\n */\n flatMapAsync<B extends Type>(f: (value: A) => PromiseLike<Stack<B>>): PromiseLike<Stack<B>>\n\n /**\n * Convert the stack to a List\n * @returns A List containing all elements\n */\n toList(): List<A>\n\n /**\n * Convert the stack to an array\n * @returns An array of all elements\n */\n toArray(): A[]\n\n /**\n * Returns a string representation of the stack\n * @returns A string representation\n */\n toString(): string\n\n /**\n * Pattern matches over the Stack, applying a handler function based on whether it's empty\n * @param patterns - Object with handler functions for Empty and NonEmpty variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Empty: () => R; NonEmpty: (values: A[]) => R }): R\n} & Traversable<A> &`\n}\n","#!/usr/bin/env node\n/**\n * functype CLI - API documentation for LLMs\n *\n * Usage:\n * npx functype # Overview of all types\n * npx functype <Type> # Detailed type documentation\n * npx functype interfaces # Interface reference\n * npx functype --json # JSON output (works with any command)\n * npx functype --full # Full TypeScript interfaces with JSDoc\n */\n\nimport { Match } from \"@/conditional\"\nimport { List } from \"@/list\"\nimport { Option } from \"@/option\"\n\nimport {\n formatInterfaces,\n formatJson,\n formatOverview,\n formatType,\n getAllTypeNames,\n getInterfacesData,\n getOverviewData,\n getType,\n} from \"./formatters\"\nimport { FULL_INTERFACES } from \"./full-interfaces\"\n\n/** CLI flags parsed from arguments */\ninterface Flags {\n json: boolean\n full: boolean\n help: boolean\n}\n\n/** Parse CLI arguments into flags and filtered args */\nconst parseArgs = (\n argv: string[],\n): {\n flags: Flags\n args: List<string>\n} => {\n const rawArgs = List(argv.slice(2))\n return {\n flags: {\n json: rawArgs.contains(\"--json\"),\n full: rawArgs.contains(\"--full\"),\n help: rawArgs.exists((a) => a === \"--help\" || a === \"-h\"),\n },\n args: rawArgs.filter((a) => !a.startsWith(\"--\") && a !== \"-h\"),\n }\n}\n\n/** Get full interface definition for a type (case-insensitive) */\nconst getFullInterface = (typeName: string): Option<string> =>\n Option(FULL_INTERFACES[typeName]).or(\n List(Object.entries(FULL_INTERFACES))\n .find(([name]) => name.toLowerCase() === typeName.toLowerCase())\n .map(([, def]) => def),\n )\n\n/** Format all full interfaces for output */\nconst formatAllFullInterfaces = (): string => {\n const header = List<string>([\"FULL INTERFACE DEFINITIONS\", \"=\".repeat(60), \"\"])\n\n const lines = List(Object.entries(FULL_INTERFACES)).foldLeft(header)((acc, [name, def]) =>\n acc.concat(List([`// ${name}`, def, \"\", \"-\".repeat(60), \"\"])),\n )\n\n return lines.toArray().join(\"\\n\").trimEnd()\n}\n\n/** Print help message */\nconst printHelp = (): void => {\n console.log(`functype - API documentation for LLMs\n\nUSAGE\n npx functype Show overview of all types\n npx functype <Type> Show detailed type documentation\n npx functype interfaces Show interface reference\n\nOPTIONS\n --full Show full TypeScript interface with JSDoc\n --json Output as JSON instead of markdown\n --help, -h Show this help message\n\nEXAMPLES\n npx functype # Overview of all data structures\n npx functype Option # Detailed Option documentation\n npx functype either # Case-insensitive lookup\n npx functype interfaces # All interface definitions\n npx functype --json # Overview as JSON\n npx functype Option --json # Option as JSON\n npx functype Option --full # Full TypeScript interface\n npx functype --full # All full interfaces (large output!)\n`)\n}\n\n/** Handle unknown type error */\nconst handleUnknownType = (command: string): void => {\n console.error(`Unknown type: ${command}`)\n console.error(\"\")\n console.error(`Available types: ${getAllTypeNames().join(\", \")}`)\n console.error(\"\")\n console.error(\"Use: npx functype interfaces - for interface reference\")\n process.exit(1)\n}\n\n/** Output a result to console */\nconst output = (content: string): void => console.log(content)\n\n/** Handle type lookup command */\nconst handleTypeLookup = (command: string, flags: Flags): void =>\n Option(getType(command)).fold(\n () => handleUnknownType(command),\n (result) => {\n if (flags.full) {\n getFullInterface(result.name).fold(\n () => output(flags.json ? formatJson({ [result.name]: result.data }) : formatType(result.name, result.data)),\n (fullInterface) =>\n output(flags.json ? formatJson({ [result.name]: { ...result.data, fullInterface } }) : fullInterface),\n )\n } else {\n output(flags.json ? formatJson({ [result.name]: result.data }) : formatType(result.name, result.data))\n }\n },\n )\n\n/** Main CLI entry point */\nconst main = (): void => {\n const { flags, args } = parseArgs(process.argv)\n\n Match(true)\n .when(\n () => flags.help,\n () => printHelp(),\n )\n .when(\n () => args.isEmpty,\n () =>\n flags.full\n ? output(flags.json ? formatJson(FULL_INTERFACES) : formatAllFullInterfaces())\n : output(flags.json ? formatJson(getOverviewData()) : formatOverview()),\n )\n .when(\n () => args.headOption.contains(\"interfaces\"),\n () => output(flags.json ? formatJson(getInterfacesData()) : formatInterfaces()),\n )\n .default(() =>\n args.headOption.fold(\n () => output(flags.json ? formatJson(getOverviewData()) : formatOverview()),\n (command) => handleTypeLookup(command, flags),\n ),\n )\n}\n\nmain()\n"],"mappings":";iHCMA,MAAa,EDJA,SCwBAC,EAAkC,CAC7C,OAAQ,CACN,YAAa,2CACb,WAAY,CAAC,UAAW,QAAS,WAAY,cAAe,YAAa,eAAgB,cAAc,CACvG,QAAS,CACP,OAAQ,CAAC,YAAa,gBAAiB,UAAW,SAAS,CAC3D,UAAW,CAAC,UAAW,cAAe,aAAc,UAAU,CAC9D,QAAS,CAAC,cAAe,aAAc,aAAc,YAAa,uBAAuB,CACzF,MAAO,CAAC,UAAW,UAAW,aAAc,WAAW,CACxD,CACF,CAED,OAAQ,CACN,YAAa,sDACb,WAAY,CAAC,UAAW,QAAS,WAAY,cAAe,cAAc,CAC1E,QAAS,CACP,OAAQ,CAAC,WAAY,UAAW,kBAAmB,iBAAiB,CACpE,UAAW,CAAC,UAAW,cAAe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a,KACtC,EAAO,EAAM,KAAO,EAAW,GAAmB,CAAC,CAAG,GAAkB,CAAC,CAChF,CACA,YACC,EAAK,WAAW,SACR,EAAO,EAAM,KAAO,EAAW,GAAiB,CAAC,CAAG,GAAgB,CAAC,CAC1E,GAAY,EAAiB,EAAS,EAAM,CAC9C,CACF,IAGC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["pkg.version","TYPES: Record<string, TypeData>","INTERFACES: Record<string, InterfaceData>","FULL_INTERFACES: Record<string, string>"],"sources":["../../package.json","../../src/cli/data.ts","../../src/cli/formatters.ts","../../src/cli/full-interfaces.ts","../../src/cli/index.ts"],"sourcesContent":["{\n \"name\": \"functype\",\n \"version\": \"0.40.0\",\n \"type\": \"module\",\n \"description\": \"A functional programming library for TypeScript, using immutable data structures and type classes\",\n \"author\": \"jordan.burke@gmail.com\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/jordanburke/functype.git\"\n },\n \"homepage\": \"https://functype.org/\",\n \"url\": \"https://github.com/jordanburke/functype\",\n \"scripts\": {\n \"validate\": \"pnpm validate:core && pnpm validate:landing\",\n \"validate:core\": \"pnpm format && pnpm lint && pnpm compile && pnpm test && pnpm docs:validate && pnpm build\",\n \"validate:landing\": \"cd landing && pnpm validate\",\n \"format\": \"prettier --write .\",\n \"format:check\": \"prettier --check .\",\n \"lint\": \"eslint ./src --fix\",\n \"lint:check\": \"eslint ./src\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage\",\n \"test:ui\": \"vitest --ui\",\n \"build\": \"rimraf dist && pnpm extract:interfaces && cross-env NODE_ENV=production tsdown\",\n \"extract:interfaces\": \"tsx scripts/extract-interfaces.ts\",\n \"build:watch\": \"tsdown --watch\",\n \"dev\": \"tsdown --watch\",\n \"compile\": \"tsc --noEmit\",\n \"clean\": \"rimraf dist\",\n \"prepublishOnly\": \"pnpm validate\",\n \"bench\": \"vitest bench\",\n \"bench:ui\": \"vitest bench --ui\",\n \"docs:preprocess\": \"tsx scripts/preprocess-docs.ts\",\n \"docs\": \"pnpm docs:preprocess && typedoc\",\n \"docs:watch\": \"typedoc --watch\",\n \"docs:sync\": \"tsx scripts/sync-docs.ts\",\n \"docs:validate\": \"tsx scripts/validate-docs.ts && tsx scripts/sync-docs.ts\",\n \"analyze:size\": \"pnpm build && node ./scripts/analyze-bundle-size.js\",\n \"landing:dev\": \"cd landing && pnpm dev\",\n \"landing:build\": \"cd landing && pnpm build\",\n \"landing:preview\": \"cd landing && pnpm preview\",\n \"cli-example\": \"npx . Option\"\n },\n \"devDependencies\": {\n \"@eslint/compat\": \"^1.4.1\",\n \"@semantic-release/commit-analyzer\": \"^13.0.1\",\n \"@semantic-release/github\": \"^11.0.6\",\n \"@semantic-release/npm\": \"^12.0.2\",\n \"@semantic-release/release-notes-generator\": \"^14.1.0\",\n \"@types/node\": \"^22.19.1\",\n \"eslint-config-functype\": \"1.3.0\",\n \"eslint-plugin-functional\": \"^9.0.2\",\n \"fast-check\": \"^4.4.0\",\n \"globals\": \"^16.5.0\",\n \"semantic-release\": \"^24.2.9\",\n \"ts-builds\": \"^1.2.1\",\n \"tsdown\": \"^0.16.8\",\n \"tsx\": \"^4.21.0\",\n \"typedoc\": \"^0.28.15\"\n },\n \"types\": \"./dist/index.d.ts\",\n \"module\": \"./dist/index.js\",\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"./option\": {\n \"import\": {\n \"types\": \"./dist/option/index.d.ts\",\n \"default\": \"./dist/option/index.js\"\n }\n },\n \"./either\": {\n \"import\": {\n \"types\": \"./dist/either/index.d.ts\",\n \"default\": \"./dist/either/index.js\"\n }\n },\n \"./try\": {\n \"import\": {\n \"types\": \"./dist/try/index.d.ts\",\n \"default\": \"./dist/try/index.js\"\n }\n },\n \"./list\": {\n \"import\": {\n \"types\": \"./dist/list/index.d.ts\",\n \"default\": \"./dist/list/index.js\"\n }\n },\n \"./conditional\": {\n \"import\": {\n \"types\": \"./dist/conditional/index.d.ts\",\n \"default\": \"./dist/conditional/index.js\"\n }\n },\n \"./do\": {\n \"import\": {\n \"types\": \"./dist/do/index.d.ts\",\n \"default\": \"./dist/do/index.js\"\n }\n },\n \"./lazy\": {\n \"import\": {\n \"types\": \"./dist/lazy/index.d.ts\",\n \"default\": \"./dist/lazy/index.js\"\n }\n },\n \"./task\": {\n \"import\": {\n \"types\": \"./dist/core/task/index.d.ts\",\n \"default\": \"./dist/core/task/index.js\"\n }\n },\n \"./fpromise\": {\n \"import\": {\n \"types\": \"./dist/fpromise/index.d.ts\",\n \"default\": \"./dist/fpromise/index.js\"\n }\n },\n \"./io\": {\n \"import\": {\n \"types\": \"./dist/io/index.d.ts\",\n \"default\": \"./dist/io/index.js\"\n }\n },\n \"./functype\": {\n \"import\": {\n \"types\": \"./dist/functype/index.d.ts\",\n \"default\": \"./dist/functype/index.js\"\n }\n },\n \"./typeclass\": {\n \"import\": {\n \"types\": \"./dist/typeclass/index.d.ts\",\n \"default\": \"./dist/typeclass/index.js\"\n }\n },\n \"./map\": {\n \"import\": {\n \"types\": \"./dist/map/index.d.ts\",\n \"default\": \"./dist/map/index.js\"\n }\n },\n \"./set\": {\n \"import\": {\n \"types\": \"./dist/set/index.d.ts\",\n \"default\": \"./dist/set/index.js\"\n }\n },\n \"./tuple\": {\n \"import\": {\n \"types\": \"./dist/tuple/index.d.ts\",\n \"default\": \"./dist/tuple/index.js\"\n }\n },\n \"./branded\": {\n \"import\": {\n \"types\": \"./dist/branded/index.d.ts\",\n \"default\": \"./dist/branded/index.js\"\n }\n },\n \"./companion\": {\n \"import\": {\n \"types\": \"./dist/companion/index.d.ts\",\n \"default\": \"./dist/companion/index.js\"\n }\n },\n \"./serialization\": {\n \"import\": {\n \"types\": \"./dist/serialization/index.d.ts\",\n \"default\": \"./dist/serialization/index.js\"\n }\n }\n },\n \"bin\": {\n \"functype\": \"./dist/cli/index.js\"\n },\n \"files\": [\n \"dist\"\n ],\n \"dependencies\": {\n \"safe-stable-stringify\": \"^2.5.0\"\n },\n \"sideEffects\": false,\n \"packageManager\": \"pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a\"\n}\n","/**\n * Curated API data for CLI output, optimized for LLM consumption\n */\n\nimport pkg from \"../../package.json\"\n\nexport const VERSION = pkg.version\n\nexport interface TypeData {\n description: string\n interfaces: string[]\n methods: {\n create?: string[]\n transform?: string[]\n extract?: string[]\n check?: string[]\n other?: string[]\n }\n}\n\nexport interface InterfaceData {\n extends?: string\n description: string\n methods: string[]\n}\n\nexport const TYPES: Record<string, TypeData> = {\n Option: {\n description: \"Safe nullable handling - Some<T> or None\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Extractable\", \"Matchable\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Option(v)\", \"Option.none()\", \"Some(v)\", \"None()\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".filter(p)\", \".ap(ff)\"],\n extract: [\".fold(n, s)\", \".orElse(d)\", \".orThrow()\", \".orNull()\", \".match({Some, None})\"],\n check: [\".isSome\", \".isNone\", \".isDefined\", \".isEmpty\"],\n },\n },\n\n Either: {\n description: \"Error handling with Left (error) or Right (success)\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Traversable\", \"PromiseLike\"],\n methods: {\n create: [\"Right(v)\", \"Left(e)\", \"Either.right(v)\", \"Either.left(e)\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".mapLeft(f)\", \".swap()\"],\n extract: [\".fold(l, r)\", \".orElse(d)\", \".orThrow()\", \".match({Left, Right})\"],\n check: [\".isRight\", \".isLeft\"],\n },\n },\n\n Try: {\n description: \"Wrap operations that may throw - Success<T> or Failure\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Extractable\", \"Matchable\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Try(() => expr)\", \"Success(v)\", \"Failure(e)\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".recover(f)\", \".recoverWith(f)\"],\n extract: [\".fold(f, s)\", \".orElse(d)\", \".orThrow()\", \".toOption()\", \".toEither()\"],\n check: [\".isSuccess\", \".isFailure\"],\n },\n },\n\n List: {\n description: \"Immutable array with functional operations\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Collection\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"List([...])\", \"List.of(...)\", \"List.empty()\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".filter(p)\", \".take(n)\", \".drop(n)\"],\n extract: [\".fold(z, f)\", \".reduce(f)\", \".head\", \".tail\", \".toArray()\"],\n check: [\".isEmpty\", \".nonEmpty\", \".size\", \".contains(v)\"],\n },\n },\n\n Set: {\n description: \"Immutable set of unique values\",\n interfaces: [\"Functor\", \"Foldable\", \"Collection\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Set([...])\", \"Set.of(...)\", \"Set.empty()\"],\n transform: [\".map(f)\", \".filter(p)\", \".union(s)\", \".intersection(s)\", \".difference(s)\"],\n extract: [\".fold(z, f)\", \".toArray()\"],\n check: [\".has(v)\", \".isEmpty\", \".size\"],\n },\n },\n\n Map: {\n description: \"Immutable key-value store\",\n interfaces: [\"SafeTraversable\", \"Collection\", \"Serializable\"],\n methods: {\n create: [\"Map([...])\", \"Map.of(...)\", \"Map.empty()\"],\n transform: [\".set(k, v)\", \".delete(k)\", \".map(f)\", \".filter(p)\"],\n extract: [\".get(k)\", \".keys()\", \".values()\", \".entries()\", \".fold(z, f)\"],\n check: [\".has(k)\", \".isEmpty\", \".size\"],\n },\n },\n\n Lazy: {\n description: \"Deferred computation with memoization\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Extractable\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Lazy(() => expr)\"],\n transform: [\".map(f)\", \".flatMap(f)\"],\n extract: [\".fold(n, s)\", \".orElse(d)\", \".orThrow()\", \".get()\"],\n check: [\".isEvaluated\"],\n },\n },\n\n LazyList: {\n description: \"Lazy sequences for large/infinite data\",\n interfaces: [\"Functor\", \"Monad\", \"Iterable\"],\n methods: {\n create: [\"LazyList.from(iter)\", \"LazyList.range(start, end)\", \"LazyList.infinite(f)\"],\n transform: [\".map(f)\", \".filter(p)\", \".take(n)\", \".drop(n)\", \".concat(ll)\"],\n extract: [\".head\", \".tail\", \".toArray()\"],\n check: [\".isEmpty\"],\n },\n },\n\n Task: {\n description: \"Async operations with cancellation and progress\",\n interfaces: [],\n methods: {\n create: [\"Task.of(v)\", \"Task.from(promise)\", \"Task.sync(f)\", \"Task.async(f)\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".mapError(f)\"],\n extract: [\".run()\", \".cancel()\"],\n other: [\".onProgress(cb)\", \".onCancel(cb)\"],\n },\n },\n\n IO: {\n description: \"Lazy effect type with typed errors and dependency injection\",\n interfaces: [\"Functor\", \"Monad\", \"Foldable\", \"Matchable\"],\n methods: {\n create: [\n \"IO(() => v)\",\n \"IO.succeed(v)\",\n \"IO.fail(e)\",\n \"IO.sync(f)\",\n \"IO.async(f)\",\n \"IO.tryPromise({try, catch})\",\n \"IO.fromEither(e)\",\n \"IO.fromOption(o)\",\n \"IO.fromTry(t)\",\n ],\n transform: [\".map(f)\", \".flatMap(f)\", \".tap(f)\", \".mapError(f)\", \".recover(v)\", \".recoverWith(f)\"],\n extract: [\n \".run()\",\n \".runSync()\",\n \".runEither()\",\n \".runExit()\",\n \".runOption()\",\n \".runTry()\",\n \".fold(onErr, onOk)\",\n \".match({failure, success})\",\n ],\n check: [],\n other: [\n \".catchTag(tag, f)\",\n \".catchAll(f)\",\n \".retry(n)\",\n \".retryWithDelay(n, ms)\",\n \".timeout(ms)\",\n \".delay(ms)\",\n \".zip(io)\",\n \".pipe(f)\",\n \"IO.all([...])\",\n \"IO.race([...])\",\n \"IO.bracket(acquire, use, release)\",\n \"IO.gen(function*() {...})\",\n \"IO.Do.bind().map()\",\n \"IO.service(Tag)\",\n \".provideService(Tag, impl)\",\n \".provideLayer(layer)\",\n ],\n },\n },\n\n FPromise: {\n description: \"Enhanced Promise with functional methods\",\n interfaces: [\"PromiseLike\"],\n methods: {\n create: [\"FPromise.of(v)\", \"FPromise.from(promise)\"],\n transform: [\".map(f)\", \".flatMap(f)\", \".mapError(f)\", \".recover(f)\"],\n extract: [\".toPromise()\", \".cancel()\"],\n },\n },\n\n Cond: {\n description: \"Conditional expression builder - replace if-else chains\",\n interfaces: [],\n methods: {\n create: [\"Cond<T>()\"],\n other: [\".case(pred, result)\", \".otherwise(result)\", \".eval()\"],\n },\n },\n\n Match: {\n description: \"Pattern matching - replace switch statements\",\n interfaces: [],\n methods: {\n create: [\"Match(value)\"],\n other: [\".case(pattern, result)\", \".when(pred, result)\", \".default(result)\", \".done()\"],\n },\n },\n\n Brand: {\n description: \"Nominal typing without runtime overhead\",\n interfaces: [],\n methods: {\n create: [\"Brand<K, T>(value)\"],\n extract: [\".unwrap()\", \".toString()\"],\n },\n },\n\n ValidatedBrand: {\n description: \"Branded types with runtime validation\",\n interfaces: [],\n methods: {\n create: [\"ValidatedBrand(validator)\", \".of(v)\", \".from(v)\", \".unsafeOf(v)\"],\n check: [\".is(v)\"],\n other: [\".refine(validator)\"],\n },\n },\n\n Tuple: {\n description: \"Fixed-size typed array\",\n interfaces: [\"Typeable\", \"Valuable\", \"Iterable\"],\n methods: {\n create: [\"Tuple([a, b, ...])\", \"Tuple.of(a, b, ...)\"],\n extract: [\".first\", \".second\", \".toArray()\"],\n transform: [\".map(f)\"],\n },\n },\n\n Stack: {\n description: \"Immutable LIFO stack\",\n interfaces: [\"Foldable\", \"Collection\", \"Serializable\", \"Traversable\"],\n methods: {\n create: [\"Stack()\", \"Stack.of(...)\"],\n transform: [\".push(v)\", \".pop()\"],\n extract: [\".peek()\", \".toArray()\"],\n check: [\".isEmpty\", \".size\"],\n },\n },\n}\n\nexport const INTERFACES: Record<string, InterfaceData> = {\n Functor: {\n description: \"Transform contained values\",\n methods: [\".map<B>(f: A => B): Functor<B>\"],\n },\n\n Applicative: {\n extends: \"Functor\",\n description: \"Apply wrapped functions\",\n methods: [\".ap<B>(ff: Applicative<A => B>): Applicative<B>\"],\n },\n\n Monad: {\n extends: \"Applicative\",\n description: \"Chain operations returning wrapped values\",\n methods: [\".flatMap<B>(f: A => Monad<B>): Monad<B>\"],\n },\n\n Foldable: {\n description: \"Extract via pattern matching\",\n methods: [\n \".fold<B>(empty: () => B, f: A => B): B\",\n \".foldLeft<B>(z: B, op: (B, A) => B): B\",\n \".foldRight<B>(z: B, op: (A, B) => B): B\",\n ],\n },\n\n Extractable: {\n description: \"Get contained value with fallback\",\n methods: [\".orElse(d: T): T\", \".orThrow(e?: Error): T\", \".orNull(): T | null\", \".orUndefined(): T | undefined\"],\n },\n\n Matchable: {\n description: \"Pattern match on type variants\",\n methods: [\".match<R>(patterns: Record<Tag, Handler>): R\"],\n },\n\n Traversable: {\n description: \"Iterate and check contents\",\n methods: [\".size: number\", \".isEmpty: boolean\", \".contains(v: A): boolean\", \".reduce<B>(f, init): B\"],\n },\n\n Collection: {\n description: \"Collection operations\",\n methods: [\".toArray(): A[]\", \".forEach(f: A => void): void\"],\n },\n\n Serializable: {\n description: \"Convert to string formats\",\n methods: [\".serialize().toJSON(): string\", \".serialize().toYAML(): string\"],\n },\n}\n\nexport const CATEGORIES = {\n Core: [\"Option\", \"Either\", \"Try\"],\n Collection: [\"List\", \"Set\", \"Map\", \"LazyList\", \"Tuple\", \"Stack\"],\n Effect: [\"IO\", \"Task\", \"FPromise\"],\n Utility: [\"Lazy\", \"Cond\", \"Match\", \"Brand\", \"ValidatedBrand\"],\n}\n","/**\n * Output formatters for CLI - markdown and JSON\n * Uses functype FP patterns for implementation\n */\n\nimport { List } from \"../list\"\nimport { Option } from \"../option\"\nimport type { InterfaceData, TypeData } from \"./data\"\nimport { CATEGORIES, INTERFACES, TYPES, VERSION } from \"./data\"\n\n/**\n * Format the library overview (default command)\n */\nexport const formatOverview = (): string => {\n const header = List<string>([`functype ${VERSION} - Scala-inspired FP for TypeScript`, \"\"])\n\n const categoryLines = List(Object.entries(CATEGORIES)).foldLeft(header)((acc, [category, typeNames]) => {\n const withCategory = acc.add(category.toUpperCase())\n const withTypes = List(typeNames).foldLeft(withCategory)((innerAcc, name) =>\n Option(TYPES[name]).fold(\n () => innerAcc,\n (type) => {\n const ifaces = type.interfaces.length > 0 ? ` [${type.interfaces.join(\", \")}]` : \"\"\n return innerAcc.add(` ${name}${ifaces}`).add(` ${type.description}`)\n },\n ),\n )\n return withTypes.add(\"\")\n })\n\n return categoryLines\n .concat(List([\"Use: npx functype <Type> for details\", \"Use: npx functype interfaces for interface reference\"]))\n .toArray()\n .join(\"\\n\")\n}\n\n/**\n * Format detailed type documentation\n */\nexport const formatType = (name: string, data: TypeData): string => {\n const ifaceList = data.interfaces.length > 0 ? ` [${data.interfaces.join(\", \")}]` : \"\"\n const categoryOrder = List([\"create\", \"transform\", \"extract\", \"check\", \"other\"] as const)\n const header = List<string>([`${name}<T>${ifaceList}`, \"\", data.description, \"\"])\n\n const lines = categoryOrder.foldLeft(header)((acc, cat) =>\n Option(data.methods[cat])\n .filter((methods) => methods.length > 0)\n .fold(\n () => acc,\n (methods) => {\n const withCat = acc.add(cat.toUpperCase())\n const withMethods = List(methods).foldLeft(withCat)((innerAcc, method) => innerAcc.add(` ${method}`))\n return withMethods.add(\"\")\n },\n ),\n )\n\n return lines.toArray().join(\"\\n\").trimEnd()\n}\n\n/**\n * Format interface reference\n */\nexport const formatInterfaces = (): string => {\n const header = List<string>([\"INTERFACES\", \"\"])\n\n const lines = List(Object.entries(INTERFACES)).foldLeft(header)((acc, [name, data]) => {\n const ext = data.extends ? ` extends ${data.extends}` : \"\"\n const withHeader = acc.add(`${name}<A>${ext}`).add(` ${data.description}`)\n const withMethods = List(data.methods).foldLeft(withHeader)((innerAcc, method) => innerAcc.add(` ${method}`))\n return withMethods.add(\"\")\n })\n\n return lines.toArray().join(\"\\n\").trimEnd()\n}\n\n/**\n * Format as JSON\n */\nexport const formatJson = (data: unknown): string => JSON.stringify(data, null, 2)\n\n/**\n * Get overview data for JSON output\n */\nexport const getOverviewData = (): {\n version: string\n categories: Record<string, string[]>\n types: Record<string, TypeData>\n} => ({\n version: VERSION,\n categories: CATEGORIES,\n types: TYPES,\n})\n\n/**\n * Get type data by name (case-insensitive)\n */\nexport const getType = (name: string): { name: string; data: TypeData } | undefined =>\n Option(TYPES[name])\n .map((data) => ({ name, data }))\n .or(\n List(Object.entries(TYPES))\n .find(([typeName]) => typeName.toLowerCase() === name.toLowerCase())\n .map(([typeName, typeData]) => ({ name: typeName, data: typeData })),\n )\n .orUndefined()\n\n/**\n * Get all type names for error messages\n */\nexport const getAllTypeNames = (): string[] => Object.keys(TYPES)\n\n/**\n * Get interfaces data for JSON output\n */\nexport const getInterfacesData = (): Record<string, InterfaceData> => INTERFACES\n","/**\n * Auto-generated full interface definitions.\n * Generated by scripts/extract-interfaces.ts\n * DO NOT EDIT MANUALLY\n */\n\nexport const FULL_INTERFACES: Record<string, string> = {\n Option: `export interface Option<T extends Type> extends Functype<T, \"Some\" | \"None\">, Promisable<T>, Doable<T>, Reshapeable<T> {\n /** The contained value (undefined for None) */\n readonly value: T | undefined\n /** Whether this Option contains no value */\n isEmpty: boolean\n /**\n * Returns true if this Option is a Some (contains a value)\n * @returns true if this Option contains a value, false otherwise\n */\n isSome(): this is Option<T> & { value: T; isEmpty: false }\n /**\n * Returns true if this Option is a None (contains no value)\n * @returns true if this Option is empty, false otherwise\n */\n isNone(): this is Option<T> & { value: undefined; isEmpty: true }\n /**\n * Returns the contained value or a default value if None\n * @param defaultValue - The value to return if this Option is None\n * @returns The contained value or defaultValue\n */\n orElse(defaultValue: T): T\n /**\n * Returns the contained value or throws an error if None\n * @param error - Optional custom error to throw. If not provided, throws a default error\n * @returns The contained value\n * @throws The specified error or a default error if the Option is None\n */\n orThrow(error?: Error): T\n /**\n * Returns this Option if it contains a value, otherwise returns the alternative container\n * @param alternative - The alternative Option to return if this is None\n * @returns This Option or the alternative\n */\n or(alternative: Option<T>): Option<T>\n /**\n * Returns the contained value or null if None\n * @returns The contained value or null\n */\n orNull(): T | null\n /**\n * Returns the contained value or undefined if None\n * @returns The contained value or undefined\n */\n orUndefined(): T | undefined\n /**\n * Maps the value inside the Option using the provided function\n * @param f - The mapping function\n * @returns A new Option containing the mapped value, or None if this Option is None\n */\n map<U extends Type>(f: (value: T) => U): Option<U>\n /**\n * Applies a wrapped function to a wrapped value (Applicative pattern)\n * @param ff - An Option containing a function from T to U\n * @returns A new Option containing the result of applying the function\n */\n ap<U extends Type>(ff: Option<(value: T) => U>): Option<U>\n /**\n * Returns this Option if it contains a value that satisfies the predicate, otherwise returns None\n * @param predicate - The predicate function to test the value\n * @returns This Option or None\n */\n filter(predicate: (value: T) => boolean): Option<T>\n /**\n * Maps the value using a function that returns an Option\n * @param f - The mapping function returning an Option\n * @returns The result of applying f to the contained value, or None if this Option is None\n */\n flatMap<U extends Type>(f: (value: T) => Option<U>): Option<U>\n /**\n * Maps the value using an async function that returns an Option\n * @param f - The async mapping function returning an Option\n * @returns Promise of the result of applying f to the contained value, or None if this Option is None\n */\n flatMapAsync<U extends Type>(f: (value: T) => Promise<Option<U>>): Promise<Option<U>>\n /**\n * Applies a binary operator to a start value and the contained value\n * @param f - The binary operator\n * @returns The result of the reduction\n */\n reduce<U>(f: (acc: U, value: T) => U): U\n /**\n * Applies a binary operator to the contained value and a start value\n * @param f - The binary operator\n * @returns The result of the reduction\n */\n reduceRight<U>(f: (acc: U, value: T) => U): U\n /**\n * Pattern matches over the Option, applying onNone if None and onSome if Some\n * @param onNone - Function to apply if the Option is None\n * @param onSome - Function to apply if the Option has a value\n * @returns The result of applying the appropriate function\n */\n fold<U>(onNone: () => U, onSome: (value: T) => U): U\n /**\n * Left-associative fold using the provided zero value and operation\n * @param z - Zero/identity value\n * @returns A function that takes an operation to apply\n */\n foldLeft<B>(z: B): (op: (b: B, a: T) => B) => B\n /**\n * Right-associative fold using the provided zero value and operation\n * @param z - Zero/identity value\n * @returns A function that takes an operation to apply\n */\n foldRight<B>(z: B): (op: (a: T, b: B) => B) => B\n /**\n * Converts this Option to a List\n * @returns A List containing the value if Some, or empty List if None\n */\n toList(): List<T>\n /**\n * Checks if this Option contains the specified value\n * @param value - The value to check for\n * @returns true if this Option contains the value, false otherwise\n */\n contains(value: T): boolean\n /** The number of elements in this Option (0 or 1) */\n size: number\n /**\n * Converts this Option to an Either\n * @param left - The value to use for Left if this Option is None\n * @returns Either.Right with the contained value if Some, or Either.Left with left if None\n */\n toEither<E>(left: E): Either<E, T>\n /**\n * Returns a string representation of this Option\n * @returns A string representation\n */\n toString(): string\n /**\n * Returns a simple object representation of this Option\n * @returns An object with _tag and value properties\n */\n toValue(): { _tag: \"Some\" | \"None\"; value: T }\n /**\n * Pattern matches over the Option, applying a handler function based on the variant\n * @param patterns - Object with handler functions for Some and None variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Some: (value: T) => R; None: () => R }): R\n}`,\n\n Either: `export interface Either<L extends Type, R extends Type>\n extends FunctypeBase<R, \"Left\" | \"Right\">, Promisable<R>, Doable<R>, Reshapeable<R>, Extractable<R> {\n readonly _tag: \"Left\" | \"Right\"\n value: L | R\n isLeft(): this is Either<L, R> & { readonly _tag: \"Left\"; value: L }\n isRight(): this is Either<L, R> & { readonly _tag: \"Right\"; value: R }\n orElse: (defaultValue: R) => R\n orThrow: (error?: Error) => R\n or(alternative: Either<L, R>): Either<L, R>\n orNull: () => R | null\n orUndefined: () => R | undefined\n readonly map: <U extends Type>(f: (value: R) => U) => Either<L, U>\n ap: <U extends Type>(ff: Either<L, (value: R) => U>) => Either<L, U>\n merge: <L1 extends Type, R1 extends Type>(other: Either<L1, R1>) => Either<L | L1, [R, R1]>\n mapAsync: <U extends Type>(f: (value: R) => Promise<U>) => Promise<Either<L, U>>\n flatMap: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U>\n flatMapAsync: <U extends Type>(f: (value: R) => Promise<Either<L, U>>) => Promise<Either<L, U>>\n toOption: () => Option<R>\n toList: () => List<R>\n toString: () => string\n [Symbol.iterator]: () => Iterator<R>\n yield: () => Generator<R, void, unknown>\n traverse: <U extends Type>(f: (value: R) => Either<L, U>) => Either<L, U[]>\n lazyMap: <U extends Type>(f: (value: R) => U) => Generator<Either<L, U>, void, unknown>\n tap: (f: (value: R) => void) => Either<L, R>\n tapLeft: (f: (value: L) => void) => Either<L, R>\n mapLeft: <L2 extends Type>(f: (value: L) => L2) => Either<L2, R>\n bimap: <L2 extends Type, R2 extends Type>(fl: (value: L) => L2, fr: (value: R) => R2) => Either<L2, R2>\n fold: <T extends Type>(onLeft: (value: L) => T, onRight: (value: R) => T) => T\n swap: () => Either<R, L>\n /**\n * Pipes the value through the provided function based on whether this is a Left or Right\n * @param onLeft - The function to apply if this is a Left\n * @param onRight - The function to apply if this is a Right\n * @returns The result of applying the appropriate function\n */\n pipeEither<U extends Type>(onLeft: (value: L) => U, onRight: (value: R) => U): U\n\n /**\n * Pipes the Either value through the provided function\n * @param f - The function to apply to the value (Left or Right)\n * @returns The result of applying the function to the value\n */\n pipe<U extends Type>(f: (value: L | R) => U): U\n /**\n * Pattern matches over the Either, applying a handler function based on the variant\n * @param patterns - Object with handler functions for Left and Right variants\n * @returns The result of applying the matching handler function\n */\n match<T>(patterns: { Left: (value: L) => T; Right: (value: R) => T }): T\n /**\n * Returns the value and tag for inspection\n */\n toValue(): { _tag: \"Left\" | \"Right\"; value: L | R }\n /**\n * Custom JSON serialization that excludes getter properties\n */\n toJSON(): { _tag: \"Left\" | \"Right\"; value: L | R }\n}`,\n\n Try: `export interface Try<T>\n extends FunctypeBase<T, TypeNames>, Extractable<T>, Pipe<T>, Promisable<T>, Doable<T>, Reshapeable<T> {\n readonly _tag: TypeNames\n readonly error: Error | undefined\n isSuccess(): this is Try<T> & { readonly _tag: \"Success\"; error: undefined }\n isFailure(): this is Try<T> & { readonly _tag: \"Failure\"; error: Error }\n orElse: (defaultValue: T) => T\n orThrow: (error?: Error) => T\n or: (alternative: Try<T>) => Try<T>\n orNull: () => T | null\n orUndefined: () => T | undefined\n toOption: () => Option<T>\n toEither: <E extends Type>(leftValue: E) => Either<E, T>\n toList: () => List<T>\n toTry: () => Try<T>\n map: <U>(f: (value: T) => U) => Try<U>\n ap: <U>(ff: Try<(value: T) => U>) => Try<U>\n flatMap: <U>(f: (value: T) => Try<U>) => Try<U>\n flatMapAsync: <U>(f: (value: T) => Promise<Try<U>>) => Promise<Try<U>>\n /**\n * Pattern matches over the Try, applying onFailure if Failure and onSuccess if Success\n * @param onFailure - Function to apply if the Try is Failure\n * @param onSuccess - Function to apply if the Try is Success\n * @returns The result of applying the appropriate function\n */\n fold: <U extends Type>(onFailure: (error: Error) => U, onSuccess: (value: T) => U) => U\n toString: () => string\n /**\n * Pattern matches over the Try, applying a handler function based on the variant\n * @param patterns - Object with handler functions for Success and Failure variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Success: (value: T) => R; Failure: (error: Error) => R }): R\n toValue(): { _tag: TypeNames; value: T | Error }\n}`,\n\n List: `export interface List<A> extends FunctypeCollection<A, \"List\">, Doable<A>, Reshapeable<A> {\n readonly length: number\n readonly [Symbol.iterator]: () => Iterator<A>\n // Override these to return List instead of FunctypeCollection\n map: <B>(f: (a: A) => B) => List<B>\n ap: <B>(ff: List<(value: A) => B>) => List<B>\n flatMap: <B>(f: (a: A) => Iterable<B>) => List<B>\n flatMapAsync: <B>(f: (a: A) => PromiseLike<Iterable<B>>) => PromiseLike<List<B>>\n // Override filter for type guard support\n filter<S extends A>(predicate: (a: A) => a is S): List<S>\n filter(predicate: (a: A) => unknown): List<A>\n filterNot: (p: (a: A) => boolean) => List<A>\n // List-specific methods\n /** @internal */\n filterType: <T extends Typeable<string, unknown>>(tag: string) => List<T & A>\n remove: (value: A) => List<A>\n removeAt: (index: number) => List<A>\n add: (item: A) => List<A>\n get: (index: number) => Option<A>\n concat: (other: List<A>) => List<A>\n /**\n * Pattern matches over the List, applying a handler function based on whether it's empty\n * @param patterns - Object with handler functions for Empty and NonEmpty variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Empty: () => R; NonEmpty: (values: A[]) => R }): R\n}`,\n\n Set: `export interface Set<A> extends FunctypeCollection<A, \"Set\">, Collection<A> {\n add: (value: A) => Set<A>\n remove: (value: A) => Set<A>\n contains: (value: A) => boolean\n has: (value: A) => boolean\n map: <B>(f: (a: A) => B) => Set<B>\n flatMap: <B>(f: (a: A) => Iterable<B>) => Set<B>\n filter: (p: (a: A) => boolean) => Set<A>\n filterNot: (p: (a: A) => boolean) => Set<A>\n fold: <U extends Type>(onEmpty: () => U, onValue: (value: A) => U) => U\n toList: () => List<A>\n toSet: () => Set<A>\n toArray: <B = A>() => B[]\n toString: () => string\n}`,\n\n Map: `export interface Map<K, V>\n extends\n SafeTraversable<K, V>,\n Collection<Tuple<[K, V]>>,\n Typeable<\"Map\">,\n Serializable<[K, V][]>,\n Pipe<[K, V][]>,\n Foldable<Tuple<[K, V]>>,\n Iterable<[K, V]> {\n readonly _tag: \"Map\"\n add(item: Tuple<[K, V]>): Map<K, V>\n remove(value: K): Map<K, V>\n map<U>(f: (value: V) => U): Map<K, U>\n ap<U>(ff: Map<K, (value: V) => U>): Map<K, U>\n flatMap<K2, V2>(f: (entry: Tuple<[K, V]>) => Iterable<[K2, V2]>): Map<K2, V2>\n flatMapAsync<U>(f: (value: V) => PromiseLike<Map<K, U>>): PromiseLike<Map<K, U>>\n get(key: K): Option<V>\n getOrElse(key: K, defaultValue: V): V\n orElse(key: K, alternative: Option<V>): Option<V>\n fold<U extends Type>(onEmpty: () => U, onValue: (value: Tuple<[K, V]>) => U): U\n foldLeft<B>(z: B): (op: (b: B, a: Tuple<[K, V]>) => B) => B\n foldRight<B>(z: B): (op: (a: Tuple<[K, V]>, b: B) => B) => B\n /**\n * Pattern matches over the Map, applying a handler function based on whether it's empty\n * @param patterns - Object with handler functions for Empty and NonEmpty variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Empty: () => R; NonEmpty: (entries: Array<Tuple<[K, V]>>) => R }): R\n toValue(): { _tag: \"Map\"; value: [K, V][] }\n}`,\n\n Lazy: `export interface Lazy<T extends Type> extends FunctypeBase<T, \"Lazy\">, Extractable<T>, Pipe<T> {\n /** Tag identifying this as a Lazy type */\n readonly _tag: \"Lazy\"\n /** Whether the computation has been evaluated */\n readonly isEvaluated: boolean\n /**\n * Returns the computed value or a default value if computation fails\n * @param defaultValue - The value to return if computation fails\n * @returns The computed value or defaultValue\n */\n orElse(defaultValue: T): T\n /**\n * Returns the computed value or null if computation fails\n * @returns The computed value or null\n */\n orNull(): T | null\n /**\n * Returns the computed value or throws an error if computation fails\n * @param error - Optional custom error to throw. If not provided, throws the computation error or a default error\n * @returns The computed value\n * @throws The specified error, computation error, or a default error\n */\n orThrow(error?: Error): T\n /**\n * Returns this Lazy if computation succeeds, otherwise returns the alternative Lazy\n * @param alternative - The alternative Lazy to use if computation fails\n * @returns This Lazy or the alternative\n */\n or(alternative: Lazy<T>): Lazy<T>\n /**\n * Maps the value inside the Lazy using the provided function\n * @param f - The mapping function\n * @returns A new Lazy containing the mapped value\n */\n map<U extends Type>(f: (value: T) => U): Lazy<U>\n /**\n * Applies a wrapped function to a wrapped value (Applicative pattern)\n * @param ff - A Lazy containing a function from T to U\n * @returns A new Lazy containing the result\n */\n ap<U extends Type>(ff: Lazy<(value: T) => U>): Lazy<U>\n /**\n * Maps the value inside the Lazy using an async function\n * @param f - The async mapping function\n * @returns A Promise of a new Lazy containing the mapped value\n */\n mapAsync<U extends Type>(f: (value: T) => Promise<U>): Promise<Lazy<U>>\n /**\n * Maps the value using a function that returns a Lazy\n * @param f - The mapping function returning a Lazy\n * @returns A new Lazy containing the flattened result\n */\n flatMap<U extends Type>(f: (value: T) => Lazy<U>): Lazy<U>\n /**\n * Maps the value using an async function that returns a Lazy\n * @param f - The async mapping function returning a Lazy\n * @returns A Promise of a new Lazy containing the flattened result\n */\n flatMapAsync<U extends Type>(f: (value: T) => Promise<Lazy<U>>): Promise<Lazy<U>>\n /**\n * Returns a Lazy that filters the value based on a predicate\n * @param predicate - The predicate function\n * @returns A Lazy containing an Option of the value\n */\n filter(predicate: (value: T) => boolean): Lazy<Option<T>>\n /**\n * Recovers from a failed computation by providing an alternative value\n * @param f - Function that takes the error and returns a recovery value\n * @returns A new Lazy that will use the recovery function if computation fails\n */\n recover(f: (error: unknown) => T): Lazy<T>\n /**\n * Recovers from a failed computation by providing an alternative Lazy\n * @param f - Function that takes the error and returns a recovery Lazy\n * @returns A new Lazy that will use the recovery Lazy if computation fails\n */\n recoverWith(f: (error: unknown) => Lazy<T>): Lazy<T>\n /**\n * Evaluates the computation and returns it as an Option\n * @returns Some containing the value if successful, None if computation fails\n */\n toOption(): Option<T>\n /**\n * Evaluates the computation and returns it as an Either\n * @returns Right containing the value if successful, Left containing the error if computation fails\n */\n toEither(): Either<unknown, T>\n /**\n * Evaluates the computation and returns it as an Either with a mapped error\n * @param mapError - Function to map the error\n * @returns Right containing the value if successful, Left containing the mapped error if computation fails\n */\n toEitherWith<E>(mapError: (error: unknown) => E): Either<E, T>\n /**\n * Evaluates the computation and returns it as a Try\n * @returns Try containing the result of the computation\n */\n toTry(): Try<T>\n /**\n * Applies an effect function to the value if computation succeeds\n * @param f - The effect function\n * @returns This Lazy for chaining\n */\n tap(f: (value: T) => void): Lazy<T>\n /**\n * Applies an effect function to the error if computation fails\n * @param f - The effect function for errors\n * @returns This Lazy for chaining\n */\n tapError(f: (error: unknown) => void): Lazy<T>\n /**\n * Pattern matching on the Lazy value\n * @param f - Function to apply to the computed value\n * @returns The result of applying f to the computed value\n */\n fold<U>(f: (value: T) => U): U\n /**\n * Pattern matching with success and failure handlers\n * @param onFailure - Function to handle computation failure\n * @param onSuccess - Function to handle successful computation\n * @returns The result of the appropriate handler\n */\n foldWith<U>(onFailure: (error: unknown) => U, onSuccess: (value: T) => U): U\n /**\n * Left fold operation\n * @param z - Initial value\n * @returns Function that takes an operator and applies it\n */\n foldLeft: <B>(z: B) => (op: (b: B, a: T) => B) => B\n /**\n * Right fold operation\n * @param z - Initial value\n * @returns Function that takes an operator and applies it\n */\n foldRight: <B>(z: B) => (op: (a: T, b: B) => B) => B\n /**\n * Pattern matching for the Lazy type\n * @param patterns - Object with handler for Lazy pattern\n * @returns The result of the matched handler\n */\n match<R>(patterns: { Lazy: (value: T) => R }): R\n /**\n * Creates a string representation of the Lazy\n * @returns String representation showing evaluation status\n */\n toString(): string\n /**\n * Converts the Lazy to a value object\n * @returns Object representation of the Lazy with evaluation state\n */\n toValue(): { _tag: \"Lazy\"; evaluated: boolean; value?: T }\n}`,\n\n LazyList: `export interface LazyList<A extends Type>\n extends Foldable<A>, Pipe<LazyList<A>>, Serializable<LazyList<A>>, Typeable<\"LazyList\"> {\n // Iterator protocol\n [Symbol.iterator](): Iterator<A>\n\n // Lazy operations\n map<B extends Type>(f: (a: A) => B): LazyList<B>\n flatMap<B extends Type>(f: (a: A) => LazyList<B>): LazyList<B>\n filter(predicate: (a: A) => boolean): LazyList<A>\n take(n: number): LazyList<A>\n drop(n: number): LazyList<A>\n takeWhile(predicate: (a: A) => boolean): LazyList<A>\n dropWhile(predicate: (a: A) => boolean): LazyList<A>\n concat(other: LazyList<A>): LazyList<A>\n zip<B extends Type>(other: LazyList<B>): LazyList<[A, B]>\n\n // Terminal operations (force evaluation)\n toList(): List<A>\n toArray(): A[]\n forEach(f: (a: A) => void): void\n reduce<B extends Type>(f: (acc: B, a: A) => B, initial: B): B\n find(predicate: (a: A) => boolean): Option<A>\n some(predicate: (a: A) => boolean): boolean\n every(predicate: (a: A) => boolean): boolean\n count(): number\n first(): Option<A>\n last(): Option<A>\n\n // Additional methods for clarity\n toString(): string\n}`,\n\n TaskOutcome: `export interface TaskOutcome<T>\n extends FunctypeBase<T, \"Ok\" | \"Err\">, Extractable<T>, AsyncMonad<T>, Promisable<T>, Doable<T> {\n readonly _tag: \"Ok\" | \"Err\"\n readonly _meta: TaskMetadata\n\n // Value access\n readonly value?: T\n readonly error?: Throwable\n\n // Functional methods\n readonly map: <U>(f: (value: T) => U) => TaskOutcome<U>\n readonly flatMap: <U>(f: (value: T) => TaskOutcome<U> | Either<Throwable, U>) => TaskOutcome<U>\n readonly ap: <U>(ff: TaskOutcome<(value: T) => U>) => TaskOutcome<U>\n readonly mapAsync: <U>(f: (value: T) => Promise<U>) => Promise<TaskOutcome<U>>\n readonly flatMapAsync: <U>(f: (value: T) => Promise<TaskOutcome<U>>) => Promise<TaskOutcome<U>>\n\n // Error handling methods\n readonly mapError: (f: (error: Throwable) => Throwable) => TaskOutcome<T>\n readonly recover: (value: T) => Ok<T>\n readonly recoverWith: (f: (error: Throwable) => T) => Ok<T>\n\n // Type guards\n readonly isSuccess: () => this is Ok<T>\n readonly isFailure: () => this is Err<T>\n readonly isOk: () => this is Ok<T>\n readonly isErr: () => this is Err<T>\n\n // Conversion methods\n readonly toEither: () => Either<Throwable, T>\n readonly toTry: () => Try<T>\n readonly toOption: () => Option<T>\n readonly toList: () => List<T>\n\n // Pattern matching\n readonly fold: <U>(onErr: (error: Throwable) => U, onOk: (value: T) => U) => U\n readonly match: <U>(patterns: { Ok: (value: T) => U; Err: (error: Throwable) => U }) => U\n}`,\n\n FPromise: `export type FPromise<T extends Type, E extends Type = unknown> = PromiseLike<T> & {\n readonly _tag: \"FPromise\"\n\n // FPromise methods\n tap: (f: (value: T) => void) => FPromise<T, E>\n mapError: <E2>(f: (error: E, context: ErrorContext) => E2) => FPromise<T, E2>\n tapError: (f: (error: E) => void) => FPromise<T, E>\n recover: (fallback: T) => FPromise<T, never>\n recoverWith: (f: (error: E) => T) => FPromise<T, never>\n recoverWithF: <E2>(f: (error: E) => FPromise<T, E2>) => FPromise<T, E2>\n filterError: <E2 extends E>(\n predicate: (error: E) => boolean,\n handler: (error: E) => FPromise<T, E2>,\n ) => FPromise<T, E>\n logError: (logger: (error: E, context: ErrorContext) => void) => FPromise<T, E>\n toPromise: () => Promise<T>\n toEither: () => Promise<Either<E, T>>\n fold: <R extends Type>(onError: (error: E) => R, onSuccess: (value: T) => R) => FPromise<R, never>\n\n // Functor implementation\n map: <U extends Type>(f: (value: T) => U) => FPromise<U, E>\n\n // AsyncFunctor implementation\n flatMap: <U extends Type>(f: (value: T) => FPromise<U, E> | PromiseLike<U>) => FPromise<U, E>\n flatMapAsync: <U extends Type>(f: (value: T) => PromiseLike<U>) => Promise<U>\n}`,\n\n Tuple: `export interface Tuple<T extends Type[]>\n extends Foldable<T[number]>, Pipe<Tuple<T>>, Serializable<Tuple<T>>, Typeable<\"Tuple\"> {\n get<K extends number>(index: K): T[K]\n\n map<U extends Type[]>(f: (value: T) => U): Tuple<U>\n\n flatMap<U extends Type[]>(f: (value: T) => Tuple<U>): Tuple<U>\n\n toArray(): T\n\n length: number\n\n [Symbol.iterator](): Iterator<T[number]>\n\n toString(): string\n\n toValue(): { _tag: \"Tuple\"; value: T }\n}`,\n\n Stack: `export type Stack<A extends Type> = {\n /**\n * Push a value onto the top of the stack\n * @param value - The value to push\n * @returns A new Stack with the value added\n */\n push(value: A): Stack<A>\n\n /**\n * Remove and return the top value from the stack\n * @returns A tuple containing the new Stack and the value\n */\n pop(): [Stack<A>, Option<A>]\n\n /**\n * Return the top value without removing it\n * @returns The top value wrapped in an Option\n */\n peek(): Option<A>\n\n /**\n * Transforms each element in the stack using the provided function\n * @param f - The mapping function\n * @returns A new Stack with transformed elements\n */\n map<B extends Type>(f: (a: A) => B): Stack<B>\n\n /**\n * Maps each element to a Stack and flattens the result\n * @param f - The mapping function returning a Stack\n * @returns A new flattened Stack\n */\n flatMap<B extends Type>(f: (a: A) => Stack<B>): Stack<B>\n\n /**\n * Applies a Stack of functions to this Stack\n * @param ff - Stack of functions to apply\n * @returns A new Stack with applied functions\n */\n ap<B extends Type>(ff: Stack<(value: A) => B>): Stack<B>\n\n /**\n * Maps each element to an async Stack and flattens the result\n * @param f - The async mapping function returning a Stack\n * @returns A promise of the new flattened Stack\n */\n flatMapAsync<B extends Type>(f: (value: A) => PromiseLike<Stack<B>>): PromiseLike<Stack<B>>\n\n /**\n * Convert the stack to a List\n * @returns A List containing all elements\n */\n toList(): List<A>\n\n /**\n * Convert the stack to an array\n * @returns An array of all elements\n */\n toArray(): A[]\n\n /**\n * Returns a string representation of the stack\n * @returns A string representation\n */\n toString(): string\n\n /**\n * Pattern matches over the Stack, applying a handler function based on whether it's empty\n * @param patterns - Object with handler functions for Empty and NonEmpty variants\n * @returns The result of applying the matching handler function\n */\n match<R>(patterns: { Empty: () => R; NonEmpty: (values: A[]) => R }): R\n} & Traversable<A> &`\n}\n","#!/usr/bin/env node\n/**\n * functype CLI - API documentation for LLMs\n *\n * Usage:\n * npx functype # Overview of all types\n * npx functype <Type> # Detailed type documentation\n * npx functype interfaces # Interface reference\n * npx functype --json # JSON output (works with any command)\n * npx functype --full # Full TypeScript interfaces with JSDoc\n */\n\nimport { Match } from \"@/conditional\"\nimport { List } from \"@/list\"\nimport { Option } from \"@/option\"\n\nimport {\n formatInterfaces,\n formatJson,\n formatOverview,\n formatType,\n getAllTypeNames,\n getInterfacesData,\n getOverviewData,\n getType,\n} from \"./formatters\"\nimport { FULL_INTERFACES } from \"./full-interfaces\"\n\n/** CLI flags parsed from arguments */\ninterface Flags {\n json: boolean\n full: boolean\n help: boolean\n}\n\n/** Parse CLI arguments into flags and filtered args */\nconst parseArgs = (\n argv: string[],\n): {\n flags: Flags\n args: List<string>\n} => {\n const rawArgs = List(argv.slice(2))\n return {\n flags: {\n json: rawArgs.contains(\"--json\"),\n full: rawArgs.contains(\"--full\"),\n help: rawArgs.exists((a) => a === \"--help\" || a === \"-h\"),\n },\n args: rawArgs.filter((a) => !a.startsWith(\"--\") && a !== \"-h\"),\n }\n}\n\n/** Get full interface definition for a type (case-insensitive) */\nconst getFullInterface = (typeName: string): Option<string> =>\n Option(FULL_INTERFACES[typeName]).or(\n List(Object.entries(FULL_INTERFACES))\n .find(([name]) => name.toLowerCase() === typeName.toLowerCase())\n .map(([, def]) => def),\n )\n\n/** Format all full interfaces for output */\nconst formatAllFullInterfaces = (): string => {\n const header = List<string>([\"FULL INTERFACE DEFINITIONS\", \"=\".repeat(60), \"\"])\n\n const lines = List(Object.entries(FULL_INTERFACES)).foldLeft(header)((acc, [name, def]) =>\n acc.concat(List([`// ${name}`, def, \"\", \"-\".repeat(60), \"\"])),\n )\n\n return lines.toArray().join(\"\\n\").trimEnd()\n}\n\n/** Print help message */\nconst printHelp = (): void => {\n console.log(`functype - API documentation for LLMs\n\nUSAGE\n npx functype Show overview of all types\n npx functype <Type> Show detailed type documentation\n npx functype interfaces Show interface reference\n\nOPTIONS\n --full Show full TypeScript interface with JSDoc\n --json Output as JSON instead of markdown\n --help, -h Show this help message\n\nEXAMPLES\n npx functype # Overview of all data structures\n npx functype Option # Detailed Option documentation\n npx functype either # Case-insensitive lookup\n npx functype interfaces # All interface definitions\n npx functype --json # Overview as JSON\n npx functype Option --json # Option as JSON\n npx functype Option --full # Full TypeScript interface\n npx functype --full # All full interfaces (large output!)\n`)\n}\n\n/** Handle unknown type error */\nconst handleUnknownType = (command: string): void => {\n console.error(`Unknown type: ${command}`)\n console.error(\"\")\n console.error(`Available types: ${getAllTypeNames().join(\", \")}`)\n console.error(\"\")\n console.error(\"Use: npx functype interfaces - for interface reference\")\n process.exit(1)\n}\n\n/** Output a result to console */\nconst output = (content: string): void => console.log(content)\n\n/** Handle type lookup command */\nconst handleTypeLookup = (command: string, flags: Flags): void =>\n Option(getType(command)).fold(\n () => handleUnknownType(command),\n (result) => {\n if (flags.full) {\n getFullInterface(result.name).fold(\n () => output(flags.json ? formatJson({ [result.name]: result.data }) : formatType(result.name, result.data)),\n (fullInterface) =>\n output(flags.json ? formatJson({ [result.name]: { ...result.data, fullInterface } }) : fullInterface),\n )\n } else {\n output(flags.json ? formatJson({ [result.name]: result.data }) : formatType(result.name, result.data))\n }\n },\n )\n\n/** Main CLI entry point */\nconst main = (): void => {\n const { flags, args } = parseArgs(process.argv)\n\n Match(true)\n .when(\n () => flags.help,\n () => printHelp(),\n )\n .when(\n () => args.isEmpty,\n () =>\n flags.full\n ? output(flags.json ? formatJson(FULL_INTERFACES) : formatAllFullInterfaces())\n : output(flags.json ? formatJson(getOverviewData()) : formatOverview()),\n )\n .when(\n () => args.headOption.contains(\"interfaces\"),\n () => output(flags.json ? formatJson(getInterfacesData()) : formatInterfaces()),\n )\n .default(() =>\n args.headOption.fold(\n () => output(flags.json ? formatJson(getOverviewData()) : formatOverview()),\n (command) => handleTypeLookup(command, flags),\n ),\n )\n}\n\nmain()\n"],"mappings":";iHCMA,MAAa,EDJA,SCwBAC,EAAkC,CAC7C,OAAQ,CACN,YAAa,2CACb,WAAY,CAAC,UAAW,QAAS,WAAY,cAAe,YAAa,eAAgB,cAAc,CACvG,QAAS,CACP,OAAQ,CAAC,YAAa,gBAAiB,UAAW,SAAS,CAC3D,UAAW,CAAC,UAAW,cAAe,aAAc,UAAU,CAC9D,QAAS,CAAC,cAAe,aAAc,aAAc,YAAa,uBAAuB,CACzF,MAAO,CAAC,UAAW,UAAW,aAAc,WAAW,CACxD,CACF,CAED,OAAQ,CACN,YAAa,sDACb,WAAY,CAAC,UAAW,QAAS,WAAY,cAAe,cAAc,CAC1E,QAAS,CACP,OAAQ,CAAC,WAAY,UAAW,kBAAmB,iBAAiB,CACpE,UAAW,CAAC,UAAW,cAAe,cAAe,UAAU,CAC/D,QAAS,CAAC,cAAe,aAAc,aAAc,wBAAwB,CAC7E,MAAO,CAAC,WAAY,UAAU,CAC/B,CACF,CAED,IAAK,CACH,YAAa,yDACb,WAAY,CAAC,UAAW,QAAS,WAAY,cAAe,YAAa,eAAgB,cAAc,CACvG,QAAS,CACP,OAAQ,CAAC,kBAAmB,aAAc,aAAa,CACvD,UAAW,CAAC,UAAW,cAA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,EAAgB,CAAG,GAAyB,CAAC,CAC5E,EAAO,EAAM,KAAO,EAAW,GAAiB,CAAC,CAAG,GAAgB,CAAC,CAC5E,CACA,SACO,EAAK,WAAW,SAAS,aAAa,KACtC,EAAO,EAAM,KAAO,EAAW,GAAmB,CAAC,CAAG,GAAkB,CAAC,CAChF,CACA,YACC,EAAK,WAAW,SACR,EAAO,EAAM,KAAO,EAAW,GAAiB,CAAC,CAAG,GAAgB,CAAC,CAC1E,GAAY,EAAiB,EAAS,EAAM,CAC9C,CACF,IAGC"}
|
package/dist/do/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../Brand-
|
|
2
|
-
import {
|
|
3
|
-
import "../Tuple-
|
|
1
|
+
import "../Brand-BPeggBaO.js";
|
|
2
|
+
import { Jn as Doable, a as EmptyListError, c as LeftError, d as isDoCapable, f as unwrap, i as DoGenerator, l as LeftErrorType, n as Do, o as FailureError, qn as DoResult, r as DoAsync, s as FailureErrorType, t as $, u as NoneError } from "../index-Bn_yRBx8.js";
|
|
3
|
+
import "../Tuple-C4maYbiO.js";
|
|
4
4
|
export { $, Do, DoAsync, DoGenerator, DoResult, Doable, EmptyListError, FailureError, FailureErrorType, LeftError, LeftErrorType, NoneError, isDoCapable, unwrap };
|
package/dist/do/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{
|
|
1
|
+
import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{A as e,F as t,I as n,M as r,N as i,O as a,P as o,j as s,k as c}from"../src-JcsaR9MX.js";export{a as $,c as Do,e as DoAsync,s as EmptyListError,r as FailureError,i as LeftError,o as NoneError,t as isDoCapable,n as unwrap};
|