functype 0.30.0 → 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/dist/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{Et as e,q as t,vt as n}from"../src-BeaSFZFq.js";const r=`0.30.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(`
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
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
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
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> {
@@ -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.30.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.3.0\",\n \"globals\": \"^16.5.0\",\n \"semantic-release\": \"^24.2.9\",\n \"ts-builds\": \"^1.1.0\",\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,MAA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AAM,GAAG,CACjB,QAAQ,MAAM,yDAAyD,CACvE,QAAQ,KAAK,EAAE,EAIX,EAAU,GAA0B,QAAQ,IAAI,EAAQ,CAGxD,GAAoB,EAAiB,IACzC,EAAO,EAAQ,EAAQ,CAAC,CAAC,SACjB,EAAkB,EAAQ,CAC/B,GAAW,CACN,EAAM,KACR,EAAiB,EAAO,KAAK,CAAC,SACtB,EAAO,EAAM,KAAO,EAAW,EAAG,EAAO,MAAO,EAAO,KAAM,CAAC,CAAG,EAAW,EAAO,KAAM,EAAO,KAAK,CAAC,CAC3G,GACC,EAAO,EAAM,KAAO,EAAW,EAAG,EAAO,MAAO,CAAE,GAAG,EAAO,KAAM,gBAAe,CAAE,CAAC,CAAG,EAAc,CACxG,CAED,EAAO,EAAM,KAAO,EAAW,EAAG,EAAO,MAAO,EAAO,KAAM,CAAC,CAAG,EAAW,EAAO,KAAM,EAAO,KAAK,CAAC,EAG3G,MAGsB,CACvB,GAAM,CAAE,QAAO,QAAS,EAAU,QAAQ,KAAK,CAE/C,EAAM,GAAK,CACR,SACO,EAAM,SACN,GAAW,CAClB,CACA,SACO,EAAK,YAET,EAAM,KACF,EAAO,EAAM,KAAO,EAAW,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"}
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,cAAe,cAAe,kBAAkB,CACvE,QAAS,CAAC,cAAe,aAAc,aAAc,cAAe,cAAc,CAClF,MAAO,CAAC,aAAc,aAAa,CACpC,CACF,CAED,KAAM,CACJ,YAAa,6CACb,WAAY,CAAC,UAAW,QAAS,WAAY,aAAc,eAAgB,cAAc,CACzF,QAAS,CACP,OAAQ,CAAC,cAAe,eAAgB,eAAe,CACvD,UAAW,CAAC,UAAW,cAAe,aAAc,WAAY,WAAW,CAC3E,QAAS,CAAC,cAAe,aAAc,QAAS,QAAS,aAAa,CACtE,MAAO,CAAC,WAAY,YAAa,QAAS,eAA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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-BiUAv9kR.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
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{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-BeaSFZFq.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};
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};
@@ -1,4 +1,4 @@
1
1
  import "../Brand-BPeggBaO.js";
2
- import { S as tryCatchAsync, _ as TypeCheckLeft, b as isRight, g as TestEither, h as Right, m as Left, p as Either, v as TypeCheckRight, x as tryCatch, y as isLeft } from "../index-BiUAv9kR.js";
2
+ import { S as tryCatchAsync, _ as TypeCheckLeft, b as isRight, g as TestEither, h as Right, m as Left, p as Either, v as TypeCheckRight, x as tryCatch, y as isLeft } from "../index-Bn_yRBx8.js";
3
3
  import "../Tuple-C4maYbiO.js";
4
4
  export { Either, Left, Right, TestEither, TypeCheckLeft, TypeCheckRight, isLeft, isRight, tryCatch, tryCatchAsync };
@@ -1 +1 @@
1
- import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{_t as e,dt as t,ft as n,gt as r,ht as i,lt as a,mt as o,pt as s,ut as c}from"../src-BeaSFZFq.js";export{a as Either,c as Left,t as Right,n as TypeCheckLeft,s as TypeCheckRight,o as isLeft,i as isRight,r as tryCatch,e as tryCatchAsync};
1
+ import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{_t as e,dt as t,ft as n,gt as r,ht as i,lt as a,mt as o,pt as s,ut as c}from"../src-JcsaR9MX.js";export{a as Either,c as Left,t as Right,n as TypeCheckLeft,s as TypeCheckRight,o as isLeft,i as isRight,r as tryCatch,e as tryCatchAsync};
@@ -1,4 +1,4 @@
1
1
  import "../Brand-BPeggBaO.js";
2
- import { cn as ErrorContext, ln as FPromise, un as FPromiseCompanion } from "../index-BiUAv9kR.js";
2
+ import { cn as ErrorContext, ln as FPromise, un as FPromiseCompanion } from "../index-Bn_yRBx8.js";
3
3
  import "../Tuple-C4maYbiO.js";
4
4
  export { ErrorContext, FPromise, FPromiseCompanion };
@@ -1 +1 @@
1
- import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{H as e,U as t}from"../src-BeaSFZFq.js";export{e as FPromise,t as FPromiseCompanion};
1
+ import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{H as e,U as t}from"../src-JcsaR9MX.js";export{e as FPromise,t as FPromiseCompanion};
@@ -2850,6 +2850,21 @@ interface IO<R$1 extends Type, E extends Type, A extends Type> {
2850
2850
  * @returns New IO with transformed error
2851
2851
  */
2852
2852
  mapError<E2 extends Type>(f: (e: E) => E2): IO<R$1, E2, A>;
2853
+ /**
2854
+ * Executes a side effect on the error without changing it.
2855
+ * Useful for logging errors while preserving the error chain.
2856
+ *
2857
+ * @param f - Side effect function to run on error
2858
+ * @returns Same IO with the side effect attached
2859
+ *
2860
+ * @example
2861
+ * ```typescript
2862
+ * const io = IO.asyncResult(() => query(), toError)
2863
+ * .tapError(err => console.error('Query failed:', err))
2864
+ * .map(data => transform(data))
2865
+ * ```
2866
+ */
2867
+ tapError(f: (e: E) => void): IO<R$1, E, A>;
2853
2868
  /**
2854
2869
  * Recovers from any error with a fallback value.
2855
2870
  * @param fallback - Value to use on error
@@ -3130,6 +3145,104 @@ declare const IO: (<A extends Type>(f: () => A | Promise<A>) => IO<never, unknow
3130
3145
  * Creates an IO from a Try.
3131
3146
  */
3132
3147
  fromTry: <A extends Type>(t: ReturnType<typeof Try<A>>) => IO<never, Error, A>;
3148
+ /**
3149
+ * Creates an IO from a result object with data/error pattern.
3150
+ * If error is present (truthy), fails with the error.
3151
+ * Otherwise succeeds with Option-wrapped data (None if data is null/undefined).
3152
+ *
3153
+ * This handles the common `{ data, error }` response pattern used by
3154
+ * Supabase, many REST APIs, and similar libraries.
3155
+ *
3156
+ * @example
3157
+ * ```typescript
3158
+ * const response = { data: user, error: null }
3159
+ * const io = IO.fromResult(response) // IO<never, null, Option<User>> -> Some(user)
3160
+ *
3161
+ * const emptyResponse = { data: null, error: null }
3162
+ * const emptyIo = IO.fromResult(emptyResponse) // IO<never, null, Option<User>> -> None
3163
+ *
3164
+ * const errorResponse = { data: null, error: new Error("Not found") }
3165
+ * const failedIo = IO.fromResult(errorResponse) // IO<never, Error, Option<null>> -> fails
3166
+ * ```
3167
+ */
3168
+ fromResult: <D extends Type, E extends Type>(result: {
3169
+ data: D | null;
3170
+ error: E | null;
3171
+ }) => IO<never, E, Option<D>>;
3172
+ /**
3173
+ * Creates an IO from an async thunk with typed error handling.
3174
+ * Catches any thrown errors and maps them using the provided function.
3175
+ * Supports cancellation via AbortSignal.
3176
+ *
3177
+ * This is a simpler alternative to `tryPromise` that takes a direct
3178
+ * error mapper function instead of an options object.
3179
+ *
3180
+ * @param f - Async function to execute (receives optional AbortSignal)
3181
+ * @param onError - Function to map caught errors to typed error E
3182
+ * @param signal - Optional AbortSignal for cancellation support
3183
+ *
3184
+ * @example
3185
+ * ```typescript
3186
+ * const io = IO.tryAsync(
3187
+ * () => fetch('/api/users').then(r => r.json()),
3188
+ * (e) => new ApiError(e)
3189
+ * )
3190
+ *
3191
+ * // With cancellation:
3192
+ * const controller = new AbortController()
3193
+ * const io = IO.tryAsync(
3194
+ * (signal) => fetch('/api/users', { signal }).then(r => r.json()),
3195
+ * (e) => new ApiError(e),
3196
+ * controller.signal
3197
+ * )
3198
+ * controller.abort() // Cancels the request
3199
+ * ```
3200
+ */
3201
+ tryAsync: <A extends Type, E extends Type>(f: (signal?: AbortSignal) => Promise<A>, onError: (error: unknown) => E, signal?: AbortSignal) => IO<never, E, A>;
3202
+ /**
3203
+ * Creates an IO from an async function that returns { data, error }.
3204
+ * Handles both:
3205
+ * - Thrown errors (mapped via onThrow)
3206
+ * - Returned errors in the result object
3207
+ * Supports cancellation via AbortSignal.
3208
+ *
3209
+ * This is the most ergonomic way to wrap Supabase and similar API calls.
3210
+ *
3211
+ * @param f - Async function returning { data, error } object (receives optional AbortSignal)
3212
+ * @param onThrow - Function to map thrown errors to typed error E
3213
+ * @param config - Optional configuration for custom field names and cancellation
3214
+ *
3215
+ * @example
3216
+ * ```typescript
3217
+ * // Supabase query in one line:
3218
+ * const getUser = (id: string): IO<never, Error, Option<User>> =>
3219
+ * IO.asyncResult(
3220
+ * () => supabase.from('users').select('*').eq('id', id).single(),
3221
+ * toError
3222
+ * )
3223
+ *
3224
+ * // With custom field names:
3225
+ * const result = IO.asyncResult(
3226
+ * () => customApi.fetch(),
3227
+ * toError,
3228
+ * { dataKey: 'result', errorKey: 'err' }
3229
+ * )
3230
+ *
3231
+ * // With cancellation:
3232
+ * const controller = new AbortController()
3233
+ * const getUser = IO.asyncResult(
3234
+ * (signal) => supabase.from('users').abortSignal(signal).select('*').single(),
3235
+ * toError,
3236
+ * { signal: controller.signal }
3237
+ * )
3238
+ * controller.abort() // Cancels the request
3239
+ * ```
3240
+ */
3241
+ asyncResult: <D extends Type, E extends Type>(f: (signal?: AbortSignal) => Promise<Record<string, unknown>>, onThrow: (error: unknown) => E, config?: {
3242
+ dataKey?: string;
3243
+ errorKey?: string;
3244
+ signal?: AbortSignal;
3245
+ }) => IO<never, E, Option<D>>;
3133
3246
  /**
3134
3247
  * Creates an IO that requires a service identified by the tag.
3135
3248
  * The service must be provided before the effect can be run.
@@ -4815,4 +4928,4 @@ interface FailureErrorType extends Error {
4815
4928
  declare const FailureError: (cause: Error, message?: string) => FailureErrorType;
4816
4929
  //#endregion
4817
4930
  export { TestClockTag as $, Task$1 as $t, OptionConstructor as A, PositiveNumber as An, ValidationRule as At, fromBinary as B, Functor as Bn, ErrorWithTaskInfo as Bt, Functype as C, EmailAddress as Cn, OptionKind as Ct, List as D, NonNegativeNumber as Dn, FieldValidation as Dt, Collection as E, NonEmptyString as En, FoldableUtils as Et, Set as F, Try as Fn, TypedError as Ft, MatchableUtils as G, Extractable as Gn, safeStringify as Gt, fromYAML as H, CollectionOps as Hn, createErrorSerializer as Ht, SerializationResult as I, TypeNames as In, TypedErrorContext as It, Map$1 as J, Doable as Jn, CancellationTokenSource as Jt, ESMap as K, isExtractable as Kn, Async as Kt, createCustomSerializer as L, Promisable as Ln, ParseError as Lt, Stack as M, UrlString as Mn, ErrorCode as Mt, Valuable as N, ValidatedBrand as Nn, ErrorMessage as Nt, None as O, PatternString as On, FormValidation as Ot, ValuableParams as P, ValidatedBrandCompanion as Pn, ErrorStatus as Pt, TestClock as Q, TaggedThrowable as Qt, createSerializationCompanion as R, Applicative as Rn, ErrorChainElement as Rt, tryCatchAsync as S, BoundedString as Sn, ListKind as St, FunctypeCollection as T, IntegerNumber as Tn, UniversalContainer as Tt, Ref as U, ContainerOps as Un, formatError as Ut, fromJSON as V, Monad as Vn, TaskErrorInfo as Vt, Matchable as W, LazyList as Wn, formatStackTrace as Wt, Traversable as X, Ok as Xt, SafeTraversable as Y, Err as Yt, Lazy as Z, Sync as Zt, TypeCheckLeft as _, CompanionMethods as _n, TagService as _t, EmptyListError as a, TaskSuccess as an, TimeoutError as at, isRight as b, Companion as bn, HKT as bt, LeftError as c, ErrorContext as cn, LayerError as ct, isDoCapable as d, NAME as dn, Exit as dt, TaskFailure as en, TestContext as et, unwrap as f, Throwable as fn, ExitTag as ft, TestEither as g, Cond as gn, Tag as gt, Right as h, Match as hn, HasService as ht, DoGenerator as i, TaskResult as in, Task as it, Some as j, UUID as jn, Validator as jt, Option as k, PositiveInteger as kn, Validation as kt, LeftErrorType as l, FPromise as ln, LayerInput as lt, Left as m, Base as mn, ContextServices as mt, Do as n, TaskOutcome as nn, InterruptedError as nt, FailureError as o, createCancellationTokenSource as on, UIO as ot, Either as p, ThrowableType as pn, Context as pt, ESMapType as q, DoResult as qn, CancellationToken as qt, DoAsync as r, TaskParams as rn, RIO as rt, FailureErrorType as s, isTaggedThrowable as sn, Layer as st, $ as t, TaskMetadata as tn, IO as tt, NoneError as u, FPromiseCompanion as un, LayerOutput as ut, TypeCheckRight as v, InstanceType as vn, Identity as vt, FunctypeBase as w, ISO8601Date as wn, TryKind as wt, tryCatch as x, BoundedNumber as xn, Kind as xt, isLeft as y, isCompanion as yn, EitherKind as yt, createSerializer as z, AsyncMonad as zn, ErrorFormatterOptions as zt };
4818
- //# sourceMappingURL=index-BiUAv9kR.d.ts.map
4931
+ //# sourceMappingURL=index-Bn_yRBx8.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { a as ExtractBrand, c as hasBrand, i as BrandedString, l as unwrapBrand, n as BrandedBoolean, o as Unwrap, r as BrandedNumber, s as createBrander, t as Brand } from "./Brand-BPeggBaO.js";
2
- import { $ as TestClockTag, $t as Task$1, A as OptionConstructor, An as PositiveNumber, At as ValidationRule, B as fromBinary, Bn as Functor, Bt as ErrorWithTaskInfo, C as Functype, Cn as EmailAddress, Ct as OptionKind, D as List, Dn as NonNegativeNumber, Dt as FieldValidation, E as Collection, En as NonEmptyString, Et as FoldableUtils, F as Set, Fn as Try, Ft as TypedError, G as MatchableUtils, Gn as Extractable, Gt as safeStringify, H as fromYAML, Hn as CollectionOps, Ht as createErrorSerializer, I as SerializationResult, In as TypeNames, It as TypedErrorContext, J as Map, Jn as Doable, Jt as CancellationTokenSource, K as ESMap, Kn as isExtractable, Kt as Async, L as createCustomSerializer, Ln as Promisable, Lt as ParseError, M as Stack, Mn as UrlString, Mt as ErrorCode, N as Valuable, Nn as ValidatedBrand, Nt as ErrorMessage, O as None, On as PatternString, Ot as FormValidation, P as ValuableParams, Pn as ValidatedBrandCompanion, Pt as ErrorStatus, Q as TestClock, Qt as TaggedThrowable, R as createSerializationCompanion, Rn as Applicative, Rt as ErrorChainElement, S as tryCatchAsync, Sn as BoundedString, St as ListKind, T as FunctypeCollection, Tn as IntegerNumber, Tt as UniversalContainer, U as Ref, Un as ContainerOps, Ut as formatError, V as fromJSON, Vn as Monad, Vt as TaskErrorInfo, W as Matchable, Wn as LazyList, Wt as formatStackTrace, X as Traversable, Xt as Ok, Y as SafeTraversable, Yt as Err, Z as Lazy, Zt as Sync, _ as TypeCheckLeft, _n as CompanionMethods, _t as TagService, a as EmptyListError, an as TaskSuccess, at as TimeoutError, b as isRight, bn as Companion, bt as HKT, c as LeftError, cn as ErrorContext, ct as LayerError, d as isDoCapable, dn as NAME, dt as Exit, en as TaskFailure, et as TestContext, f as unwrap, fn as Throwable, ft as ExitTag, g as TestEither, gn as Cond, gt as Tag, h as Right, hn as Match, ht as HasService, i as DoGenerator, in as TaskResult, it as Task, j as Some, jn as UUID, jt as Validator, k as Option, kn as PositiveInteger, kt as Validation, l as LeftErrorType, ln as FPromise, lt as LayerInput, m as Left, mn as Base, mt as ContextServices, n as Do, nn as TaskOutcome, nt as InterruptedError, o as FailureError, on as createCancellationTokenSource, ot as UIO, p as Either, pn as ThrowableType, pt as Context, q as ESMapType, qn as DoResult, qt as CancellationToken, r as DoAsync, rn as TaskParams, rt as RIO, s as FailureErrorType, sn as isTaggedThrowable, st as Layer, t as $, tn as TaskMetadata, tt as IO, u as NoneError, un as FPromiseCompanion, ut as LayerOutput, v as TypeCheckRight, vn as InstanceType, vt as Identity, w as FunctypeBase, wn as ISO8601Date, wt as TryKind, x as tryCatch, xn as BoundedNumber, xt as Kind, y as isLeft, yn as isCompanion, yt as EitherKind, z as createSerializer, zn as AsyncMonad, zt as ErrorFormatterOptions } from "./index-BiUAv9kR.js";
2
+ import { $ as TestClockTag, $t as Task$1, A as OptionConstructor, An as PositiveNumber, At as ValidationRule, B as fromBinary, Bn as Functor, Bt as ErrorWithTaskInfo, C as Functype, Cn as EmailAddress, Ct as OptionKind, D as List, Dn as NonNegativeNumber, Dt as FieldValidation, E as Collection, En as NonEmptyString, Et as FoldableUtils, F as Set, Fn as Try, Ft as TypedError, G as MatchableUtils, Gn as Extractable, Gt as safeStringify, H as fromYAML, Hn as CollectionOps, Ht as createErrorSerializer, I as SerializationResult, In as TypeNames, It as TypedErrorContext, J as Map, Jn as Doable, Jt as CancellationTokenSource, K as ESMap, Kn as isExtractable, Kt as Async, L as createCustomSerializer, Ln as Promisable, Lt as ParseError, M as Stack, Mn as UrlString, Mt as ErrorCode, N as Valuable, Nn as ValidatedBrand, Nt as ErrorMessage, O as None, On as PatternString, Ot as FormValidation, P as ValuableParams, Pn as ValidatedBrandCompanion, Pt as ErrorStatus, Q as TestClock, Qt as TaggedThrowable, R as createSerializationCompanion, Rn as Applicative, Rt as ErrorChainElement, S as tryCatchAsync, Sn as BoundedString, St as ListKind, T as FunctypeCollection, Tn as IntegerNumber, Tt as UniversalContainer, U as Ref, Un as ContainerOps, Ut as formatError, V as fromJSON, Vn as Monad, Vt as TaskErrorInfo, W as Matchable, Wn as LazyList, Wt as formatStackTrace, X as Traversable, Xt as Ok, Y as SafeTraversable, Yt as Err, Z as Lazy, Zt as Sync, _ as TypeCheckLeft, _n as CompanionMethods, _t as TagService, a as EmptyListError, an as TaskSuccess, at as TimeoutError, b as isRight, bn as Companion, bt as HKT, c as LeftError, cn as ErrorContext, ct as LayerError, d as isDoCapable, dn as NAME, dt as Exit, en as TaskFailure, et as TestContext, f as unwrap, fn as Throwable, ft as ExitTag, g as TestEither, gn as Cond, gt as Tag, h as Right, hn as Match, ht as HasService, i as DoGenerator, in as TaskResult, it as Task, j as Some, jn as UUID, jt as Validator, k as Option, kn as PositiveInteger, kt as Validation, l as LeftErrorType, ln as FPromise, lt as LayerInput, m as Left, mn as Base, mt as ContextServices, n as Do, nn as TaskOutcome, nt as InterruptedError, o as FailureError, on as createCancellationTokenSource, ot as UIO, p as Either, pn as ThrowableType, pt as Context, q as ESMapType, qn as DoResult, qt as CancellationToken, r as DoAsync, rn as TaskParams, rt as RIO, s as FailureErrorType, sn as isTaggedThrowable, st as Layer, t as $, tn as TaskMetadata, tt as IO, u as NoneError, un as FPromiseCompanion, ut as LayerOutput, v as TypeCheckRight, vn as InstanceType, vt as Identity, w as FunctypeBase, wn as ISO8601Date, wt as TryKind, x as tryCatch, xn as BoundedNumber, xt as Kind, y as isLeft, yn as isCompanion, yt as EitherKind, z as createSerializer, zn as AsyncMonad, zt as ErrorFormatterOptions } from "./index-Bn_yRBx8.js";
3
3
  import { a as isTypeable, c as Pipe, i as TypeableParams, l as Foldable, n as ExtractTag, o as Serializable, r as Typeable, s as SerializationMethods, t as Tuple, u as Type } from "./Tuple-C4maYbiO.js";
4
4
  export { $, Applicative, Async, AsyncMonad, Base, BoundedNumber, BoundedString, Brand, BrandedBoolean, BrandedBoolean as BrandedBooleanType, BrandedNumber, BrandedNumber as BrandedNumberType, BrandedString, BrandedString as BrandedStringType, CancellationToken, CancellationTokenSource, Collection, CollectionOps, Companion, CompanionMethods, Cond, ContainerOps, Context, Context as ContextType, ContextServices, Do, DoAsync, DoGenerator, DoResult, Doable, ESMap, ESMapType, Either, EitherKind, EmailAddress, EmptyListError, Err, ErrorChainElement, ErrorCode, ErrorContext, ErrorFormatterOptions, ErrorMessage, ErrorStatus, ErrorWithTaskInfo, Exit, Exit as ExitType, ExitTag, ExtractBrand, ExtractTag, Extractable, FPromise, FPromiseCompanion, FailureError, FailureErrorType, FieldValidation, Foldable, FoldableUtils, FormValidation, Functor, Functype, FunctypeBase, FunctypeCollection, HKT, HasService, IO, IO as IOType, Task as IOTask, ISO8601Date, Identity, InstanceType, IntegerNumber, InterruptedError, Kind, Layer, Layer as LayerType, LayerError, LayerInput, LayerOutput, Lazy, Lazy as LazyType, LazyList, Left, LeftError, LeftErrorType, List, ListKind, Map, Match, Matchable, MatchableUtils, Monad, NAME, NonEmptyString, NonNegativeNumber, None, NoneError, Ok, Option, OptionConstructor, OptionKind, ParseError, PatternString, Pipe, PositiveInteger, PositiveNumber, Promisable, RIO, Ref, Ref as RefType, Right, SafeTraversable, Serializable, SerializationMethods, SerializationResult, Set, Some, Stack, Sync, Tag, Tag as TagType, TagService, TaggedThrowable, Task$1 as Task, TaskErrorInfo, TaskFailure, TaskMetadata, TaskOutcome, TaskParams, TaskResult, TaskSuccess, TestClock, TestClock as TestClockType, TestClockTag, TestContext, TestContext as TestContextType, TestEither, Throwable, ThrowableType, TimeoutError, Traversable, Try, TryKind, Tuple, Type, TypeCheckLeft, TypeCheckRight, TypeNames, Typeable, TypeableParams, TypedError, TypedErrorContext, UIO, UUID, UniversalContainer, Unwrap, UrlString, ValidatedBrand, ValidatedBrand as ValidatedBrandType, ValidatedBrandCompanion, Validation, ValidationRule, Validator, Valuable, ValuableParams, createBrander, createCancellationTokenSource, createCustomSerializer, createErrorSerializer, createSerializationCompanion, createSerializer, formatError, formatStackTrace, fromBinary, fromJSON, fromYAML, hasBrand, isCompanion, isDoCapable, isExtractable, isLeft, isRight, isTaggedThrowable, isTypeable, safeStringify, tryCatch, tryCatchAsync, unwrap, unwrapBrand };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./Brand-Cfr5zy8F.js";import{n as s,t as c}from"./Tuple-CgX4p79w.js";import{$ as l,A as u,At as d,B as f,C as p,Ct as m,D as h,Dt as g,E as _,Et as v,F as y,G as b,H as x,I as S,J as C,K as w,L as T,M as E,Mt as D,N as O,Nt as k,O as A,Ot as j,P as M,Pt as N,Q as P,R as F,S as I,St as L,T as R,Tt as z,U as B,V,W as H,X as U,Y as W,Z as G,_ as K,_t as q,a as J,at as Y,b as X,bt as Z,c as Q,ct as $,d as ee,dt as te,et as ne,f as re,ft as ie,g as ae,gt as oe,h as se,ht as ce,i as le,it as ue,j as de,jt as fe,k as pe,kt as me,l as he,lt as ge,m as _e,mt as ve,n as ye,nt as be,o as xe,ot as Se,p as Ce,pt as we,q as Te,r as Ee,rt as De,s as Oe,st as ke,t as Ae,tt as je,u as Me,ut as Ne,v as Pe,vt as Fe,w as Ie,wt as Le,x as Re,xt as ze,y as Be,yt as Ve,z as He}from"./src-BeaSFZFq.js";export{A as $,w as Base,U as BoundedNumber,G as BoundedString,o as Brand,n as BrandedBoolean,i as BrandedNumber,t as BrandedString,s as Companion,C as Cond,ae as Context,pe as Do,u as DoAsync,J as ESMap,ge as Either,P as EmailAddress,de as EmptyListError,T as Err,se as Exit,x as FPromise,B as FPromiseCompanion,E as FailureError,Be as FoldableUtils,Pe as HKT,re as IO,l as ISO8601Date,K as Identity,ne as IntegerNumber,Ce as InterruptedError,ee as Layer,xe as Lazy,L as LazyList,Ne as Left,O as LeftError,Fe as List,le as Map,Te as Match,Ee as MatchableUtils,H as NAME,je as NonEmptyString,be as NonNegativeNumber,z as None,M as NoneError,F as Ok,v as Option,g as OptionConstructor,p as ParseError,De as PatternString,ue as PositiveInteger,Y as PositiveNumber,m as Ref,te as Right,Le as Set,j as Some,ye as Stack,Me as Tag,He as Task,Oe as TestClock,Q as TestClockTag,he as TestContext,b as Throwable,_e as TimeoutError,ze as Try,c as Tuple,ie as TypeCheckLeft,we as TypeCheckRight,Ve as Typeable,I as TypedError,Se as UUID,ke as UrlString,$ as ValidatedBrand,Re as Validation,Ae as Valuable,e as createBrander,f as createCancellationTokenSource,me as createCustomSerializer,Ie as createErrorSerializer,d as createSerializationCompanion,fe as createSerializer,R as formatError,_ as formatStackTrace,D as fromBinary,k as fromJSON,N as fromYAML,r as hasBrand,W as isCompanion,y as isDoCapable,X as isExtractable,ve as isLeft,ce as isRight,V as isTaggedThrowable,Z as isTypeable,h as safeStringify,oe as tryCatch,q as tryCatchAsync,S as unwrap,a as unwrapBrand};
1
+ import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./Brand-Cfr5zy8F.js";import{n as s,t as c}from"./Tuple-CgX4p79w.js";import{$ as l,A as u,At as d,B as f,C as p,Ct as m,D as h,Dt as g,E as _,Et as v,F as y,G as b,H as x,I as S,J as C,K as w,L as T,M as E,Mt as D,N as O,Nt as k,O as A,Ot as j,P as M,Pt as N,Q as P,R as F,S as I,St as L,T as R,Tt as z,U as B,V,W as H,X as U,Y as W,Z as G,_ as K,_t as q,a as J,at as Y,b as X,bt as Z,c as Q,ct as $,d as ee,dt as te,et as ne,f as re,ft as ie,g as ae,gt as oe,h as se,ht as ce,i as le,it as ue,j as de,jt as fe,k as pe,kt as me,l as he,lt as ge,m as _e,mt as ve,n as ye,nt as be,o as xe,ot as Se,p as Ce,pt as we,q as Te,r as Ee,rt as De,s as Oe,st as ke,t as Ae,tt as je,u as Me,ut as Ne,v as Pe,vt as Fe,w as Ie,wt as Le,x as Re,xt as ze,y as Be,yt as Ve,z as He}from"./src-JcsaR9MX.js";export{A as $,w as Base,U as BoundedNumber,G as BoundedString,o as Brand,n as BrandedBoolean,i as BrandedNumber,t as BrandedString,s as Companion,C as Cond,ae as Context,pe as Do,u as DoAsync,J as ESMap,ge as Either,P as EmailAddress,de as EmptyListError,T as Err,se as Exit,x as FPromise,B as FPromiseCompanion,E as FailureError,Be as FoldableUtils,Pe as HKT,re as IO,l as ISO8601Date,K as Identity,ne as IntegerNumber,Ce as InterruptedError,ee as Layer,xe as Lazy,L as LazyList,Ne as Left,O as LeftError,Fe as List,le as Map,Te as Match,Ee as MatchableUtils,H as NAME,je as NonEmptyString,be as NonNegativeNumber,z as None,M as NoneError,F as Ok,v as Option,g as OptionConstructor,p as ParseError,De as PatternString,ue as PositiveInteger,Y as PositiveNumber,m as Ref,te as Right,Le as Set,j as Some,ye as Stack,Me as Tag,He as Task,Oe as TestClock,Q as TestClockTag,he as TestContext,b as Throwable,_e as TimeoutError,ze as Try,c as Tuple,ie as TypeCheckLeft,we as TypeCheckRight,Ve as Typeable,I as TypedError,Se as UUID,ke as UrlString,$ as ValidatedBrand,Re as Validation,Ae as Valuable,e as createBrander,f as createCancellationTokenSource,me as createCustomSerializer,Ie as createErrorSerializer,d as createSerializationCompanion,fe as createSerializer,R as formatError,_ as formatStackTrace,D as fromBinary,k as fromJSON,N as fromYAML,r as hasBrand,W as isCompanion,y as isDoCapable,X as isExtractable,ve as isLeft,ce as isRight,V as isTaggedThrowable,Z as isTypeable,h as safeStringify,oe as tryCatch,q as tryCatchAsync,S as unwrap,a as unwrapBrand};
@@ -1,4 +1,4 @@
1
1
  import "../Brand-BPeggBaO.js";
2
- import { D as List } from "../index-BiUAv9kR.js";
2
+ import { D as List } from "../index-Bn_yRBx8.js";
3
3
  import "../Tuple-C4maYbiO.js";
4
4
  export { List };
@@ -1 +1 @@
1
- import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{vt as e}from"../src-BeaSFZFq.js";export{e as List};
1
+ import"../Brand-Cfr5zy8F.js";import"../Tuple-CgX4p79w.js";import{vt as e}from"../src-JcsaR9MX.js";export{e as List};