functype 0.40.0 → 0.41.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.
Files changed (46) hide show
  1. package/dist/Brand-BPeggBaO.d.ts +1 -2
  2. package/dist/Brand-Cfr5zy8F.js +1 -2
  3. package/dist/Tuple-C4maYbiO.d.ts +1 -2
  4. package/dist/Tuple-CgX4p79w.js +1 -2
  5. package/dist/cli/index.js +2 -3
  6. package/dist/do/index.d.ts +1 -1
  7. package/dist/do/index.js +1 -1
  8. package/dist/either/index.d.ts +1 -1
  9. package/dist/either/index.js +1 -1
  10. package/dist/fpromise/index.d.ts +1 -1
  11. package/dist/fpromise/index.js +1 -1
  12. package/dist/{index-Bn_yRBx8.d.ts → index-B6Civ4kr.d.ts} +19 -9
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/list/index.d.ts +1 -1
  16. package/dist/list/index.js +1 -1
  17. package/dist/map/index.d.ts +1 -1
  18. package/dist/map/index.js +1 -1
  19. package/dist/option/index.d.ts +1 -1
  20. package/dist/option/index.js +1 -1
  21. package/dist/set/index.d.ts +1 -1
  22. package/dist/set/index.js +1 -1
  23. package/dist/{src-JcsaR9MX.js → src-DpfaJv6K.js} +2 -3
  24. package/dist/try/index.d.ts +1 -1
  25. package/dist/try/index.js +1 -1
  26. package/package.json +35 -38
  27. package/README.processed.md +0 -862
  28. package/dist/Brand-Cfr5zy8F.js.map +0 -1
  29. package/dist/Tuple-CgX4p79w.js.map +0 -1
  30. package/dist/cli/index.js.map +0 -1
  31. package/dist/src-JcsaR9MX.js.map +0 -1
  32. package/readme/BRAND_MIGRATION_GUIDE.md +0 -230
  33. package/readme/BUNDLE_OPTIMIZATION.md +0 -74
  34. package/readme/FPromise-Assessment.md +0 -43
  35. package/readme/HKT.md +0 -110
  36. package/readme/ROADMAP.md +0 -113
  37. package/readme/TASK-TODO.md +0 -33
  38. package/readme/TUPLE-EXAMPLES.md +0 -76
  39. package/readme/TaskMigration.md +0 -129
  40. package/readme/ai-guide.md +0 -406
  41. package/readme/examples.md +0 -2093
  42. package/readme/functype-changes-required.md +0 -189
  43. package/readme/quick-reference.md +0 -514
  44. package/readme/task-error-handling.md +0 -283
  45. package/readme/tasks.md +0 -203
  46. package/readme/type-index.md +0 -238
@@ -1 +0,0 @@
1
- {"version":3,"file":"Brand-Cfr5zy8F.js","names":[],"sources":["../src/branded/Brand.ts"],"sourcesContent":["// Phantom type brand - exists only at compile time\n// Must use type alias (not interface) because we need intersection with primitives\nexport type Brand<K extends string, T> = T & {\n readonly __brand: K\n}\n\n// Utility type to extract the underlying type from a branded type\n// Handles both Brand and ValidatedBrand\nexport type Unwrap<T> = T extends Brand<string, infer U> ? U : T\n\n// Utility type to extract the brand from a branded type\nexport type ExtractBrand<T> = T extends Brand<infer K, unknown> ? K : never\n\n/**\n * Brand is a utility for creating nominal typing in TypeScript.\n * It creates phantom types that exist only at compile time.\n * At runtime, the branded value IS the primitive value.\n *\n * @param _brand\n * @param value - The value to brand\n * @returns The value with phantom type brand\n */\nexport function Brand<K extends string, T>(_brand: K, value: T): Brand<K, T> {\n // Just return the value with a type assertion\n // No runtime modification - the brand exists only in TypeScript\n return value as Brand<K, T>\n}\n\n/**\n * Helper to unwrap a branded value to its underlying type\n * Works with both Brand and ValidatedBrand\n * @param branded - The branded value (can be null or undefined)\n * @returns The original value without the brand\n *\n * Note: Also exported as 'unwrap' from 'functype/branded' for convenience\n */\nexport function unwrapBrand<K extends string, T>(branded: Brand<K, T>): T\nexport function unwrapBrand<K extends string, T>(branded: Brand<K, T> | null): T | null\nexport function unwrapBrand<K extends string, T>(branded: Brand<K, T> | undefined): T | undefined\nexport function unwrapBrand<K extends string, T>(branded: Brand<K, T> | null | undefined): T | null | undefined\nexport function unwrapBrand<K extends string, T>(branded: Brand<K, T> | null | undefined): T | null | undefined {\n // Handle null/undefined\n if (branded === null || branded === undefined) {\n return branded\n }\n // Since branded values (both Brand and ValidatedBrand) ARE their primitives, just return as-is\n return branded as unknown as T\n}\n\n// Convenience alias for branded module users\nexport { unwrapBrand as unwrap }\n\n/**\n * Type guard for checking if a value has a specific brand\n * @param value - The value to check\n * @param _brand - The brand to check for (unused at runtime)\n * @returns True if the value has the specified brand\n *\n * Note: Since brands are phantom types that exist only at compile time,\n * this function can only provide a runtime approximation. It always returns true\n * for non-null values, as we have no way to actually check the brand at runtime.\n * This function is primarily for API consistency and documentation purposes.\n */\nexport function hasBrand<K extends string, T>(value: unknown, _brand: K): value is Brand<K, T> {\n // In a phantom type system, we can't actually check the brand at runtime\n // We can only verify the value exists\n return value !== null && value !== undefined\n}\n\n/**\n * Create a branded type constructor for a specific brand\n * @param brand - The brand name\n * @returns A function that brands values with the specified brand\n */\nexport function createBrander<K extends string, T>(brand: K) {\n return (value: T): Brand<K, T> => Brand(brand, value)\n}\n\n// Common branded primitive types\nexport type BrandedString<K extends string> = Brand<K, string>\nexport type BrandedNumber<K extends string> = Brand<K, number>\nexport type BrandedBoolean<K extends string> = Brand<K, boolean>\n\n// Factory for common primitive branded types\nexport const BrandedString =\n <K extends string>(brand: K) =>\n (value: string): BrandedString<K> =>\n Brand(brand, value)\n\nexport const BrandedNumber =\n <K extends string>(brand: K) =>\n (value: number): BrandedNumber<K> =>\n Brand(brand, value)\n\nexport const BrandedBoolean =\n <K extends string>(brand: K) =>\n (value: boolean): BrandedBoolean<K> =>\n Brand(brand, value)\n"],"mappings":"AAsBA,SAAgB,EAA2B,EAAW,EAAuB,CAG3E,OAAO,EAeT,SAAgB,EAAiC,EAA+D,CAM9G,OAJI,GACK,EAoBX,SAAgB,EAA8B,EAAgB,EAAiC,CAG7F,OAAO,GAAU,KAQnB,SAAgB,EAAmC,EAAU,CAC3D,MAAQ,IAA0B,EAAM,EAAO,EAAM,CASvD,MAAa,EACQ,GAClB,GACC,EAAM,EAAO,EAAM,CAEV,EACQ,GAClB,GACC,EAAM,EAAO,EAAM,CAEV,EACQ,GAClB,GACC,EAAM,EAAO,EAAM"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tuple-CgX4p79w.js","names":["tuple: Tuple<T>"],"sources":["../src/companion/Companion.ts","../src/tuple/Tuple.ts"],"sourcesContent":["/**\n * Creates a function-object hybrid similar to Scala's companion objects.\n * This utility allows creating TypeScript function objects with attached methods,\n * mimicking Scala's class + companion object pattern without using classes.\n *\n * @param object The main function that will be invoked when the object is called\n * @param companion Additional static methods to attach to the function\n * @returns A function with the attached methods\n *\n * @example\n * const greet = (name: string) => `Hello, ${name}!`;\n * const methods = {\n * formal: (name: string) => `Good day, ${name}.`,\n * casual: (name: string) => `Hey ${name}!`\n * };\n * const Greeter = createCompanionObject(greet, methods);\n *\n * // Usage:\n * Greeter(\"World\"); // Hello, World!\n * Greeter.formal(\"Sir\"); // Good day, Sir.\n * Greeter.casual(\"Friend\"); // Hey Friend!\n */\nexport function Companion<ObjectF extends object, CompanionF extends object>(\n object: ObjectF,\n companion: CompanionF,\n): ObjectF & CompanionF {\n // eslint-disable-next-line functional/immutable-data\n return Object.assign(object, companion)\n}\n","import stringify from \"safe-stable-stringify\"\n\nimport { Companion } from \"@/companion/Companion\"\nimport type { Foldable } from \"@/foldable/Foldable\"\nimport type { Pipe } from \"@/pipe\"\nimport type { Serializable } from \"@/serializable/Serializable\"\nimport type { Typeable } from \"@/typeable/Typeable\"\nimport type { Type } from \"@/types\"\n\nexport 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\nconst TupleObject = <T extends Type[]>(values: T): Tuple<T> => {\n const tuple: Tuple<T> = {\n _tag: \"Tuple\",\n map: <U extends Type[]>(f: (value: T) => U): Tuple<U> => {\n const mapValue = f(values)\n return Tuple(mapValue)\n },\n\n flatMap: <U extends Type[]>(f: (value: T) => Tuple<U>): Tuple<U> => {\n return f(values)\n },\n\n get: <K extends number>(index: K): T[K] => {\n return values[index]\n },\n\n toArray: (): T => {\n return values\n },\n\n length: values.length,\n\n [Symbol.iterator](): Iterator<T[number]> {\n let index = 0\n return {\n next: (): IteratorResult<T[number]> => {\n if (index < values.length) {\n return {\n value: values[index++],\n done: false,\n }\n } else {\n return {\n value: undefined,\n done: true,\n }\n }\n },\n }\n },\n\n // Foldable implementation\n fold: <B>(onEmpty: () => B, onValue: (value: T[number]) => B): B => {\n return values.length === 0 ? onEmpty() : onValue(values[0]!)\n },\n\n foldLeft:\n <B>(z: B) =>\n (op: (b: B, a: T[number]) => B) => {\n return values.reduce(op, z)\n },\n\n foldRight:\n <B>(z: B) =>\n (op: (a: T[number], b: B) => B): B => {\n return values.reduceRight<B>((acc, value) => op(value, acc), z)\n },\n\n // Pipe implementation\n pipe: <U>(f: (value: Tuple<T>) => U): U => f(tuple),\n\n // Serializable implementation\n serialize: () => {\n return {\n toJSON: () => JSON.stringify({ _tag: \"Tuple\", value: values }),\n toYAML: () => `_tag: Tuple\\nvalue: ${stringify(values)}`,\n toBinary: () => Buffer.from(JSON.stringify({ _tag: \"Tuple\", value: values })).toString(\"base64\"),\n }\n },\n\n // Valuable implementation\n toValue: () => ({ _tag: \"Tuple\", value: values }),\n\n toString: () => `Tuple(${values.map((v) => String(v)).join(\", \")})`,\n }\n\n return tuple\n}\n\nconst TupleConstructor = <T extends Type[]>(values: T): Tuple<T> => {\n return TupleObject(values)\n}\n\nconst TupleCompanion = {\n /**\n * Create a Tuple from multiple arguments\n * @example\n * const t = Tuple.of(1, \"hello\", true)\n * // TypeScript infers: Tuple<[number, string, boolean]>\n */\n of: <T extends Type[]>(...values: T): Tuple<T> => {\n return TupleObject(values)\n },\n\n /**\n * Create a Tuple of size 2 (pair)\n * @example\n * const pair = Tuple.pair(\"key\", 42)\n * // TypeScript infers: Tuple<[string, number]>\n */\n pair: <A extends Type, B extends Type>(first: A, second: B): Tuple<[A, B]> => {\n return TupleObject([first, second] as [A, B])\n },\n\n /**\n * Create a Tuple of size 3 (triple)\n * @example\n * const triple = Tuple.triple(\"x\", 10, true)\n * // TypeScript infers: Tuple<[string, number, boolean]>\n */\n triple: <A extends Type, B extends Type, C extends Type>(first: A, second: B, third: C): Tuple<[A, B, C]> => {\n return TupleObject([first, second, third] as [A, B, C])\n },\n\n /**\n * Create an empty Tuple\n * @example\n * const empty = Tuple.empty()\n * // TypeScript infers: Tuple<[]>\n */\n empty: (): Tuple<[]> => {\n return TupleObject([] as [])\n },\n\n /**\n * Create a Tuple from an array (alias for constructor)\n * @example\n * const t = Tuple.from([1, 2, 3])\n */\n from: <T extends Type[]>(values: T): Tuple<T> => {\n return TupleObject(values)\n },\n}\n\n/**\n * Tuple provides a type-safe, fixed-length array with functional operations.\n *\n * @example\n * // Creating tuples\n * const t1 = Tuple([1, \"hello\", true])\n * const t2 = Tuple.of(1, \"hello\", true)\n * const pair = Tuple.pair(\"key\", 42)\n *\n * @example\n * // Type-safe access\n * const triple = Tuple.triple(\"x\", 10, true)\n * const first = triple.get(0) // string\n * const second = triple.get(1) // number\n * const third = triple.get(2) // boolean\n *\n * @example\n * // Functional operations\n * const doubled = Tuple([1, 2, 3])\n * .map(arr => arr.map(x => x * 2))\n * .toArray() // [2, 4, 6]\n */\nexport const Tuple = Companion(TupleConstructor, TupleCompanion)\n"],"mappings":"qCAsBA,SAAgB,EACd,EACA,EACsB,CAEtB,OAAO,OAAO,OAAO,EAAQ,EAAU,CCCzC,MAAM,EAAiC,GAAwB,CAC7D,IAAMA,EAAkB,CACtB,KAAM,QACN,IAAwB,GAEf,EADU,EAAE,EAAO,CACJ,CAGxB,QAA4B,GACnB,EAAE,EAAO,CAGlB,IAAwB,GACf,EAAO,GAGhB,YACS,EAGT,OAAQ,EAAO,OAEf,CAAC,OAAO,WAAiC,CACvC,IAAI,EAAQ,EACZ,MAAO,CACL,SACM,EAAQ,EAAO,OACV,CACL,MAAO,EAAO,KACd,KAAM,GACP,CAEM,CACL,MAAO,IAAA,GACP,KAAM,GACP,CAGN,EAIH,MAAU,EAAkB,IACnB,EAAO,SAAW,EAAI,GAAS,CAAG,EAAQ,EAAO,GAAI,CAG9D,SACM,GACH,GACQ,EAAO,OAAO,EAAI,EAAE,CAG/B,UACM,GACH,GACQ,EAAO,aAAgB,EAAK,IAAU,EAAG,EAAO,EAAI,CAAE,EAAE,CAInE,KAAU,GAAiC,EAAE,EAAM,CAGnD,eACS,CACL,WAAc,KAAK,UAAU,CAAE,KAAM,QAAS,MAAO,EAAQ,CAAC,CAC9D,WAAc,uBAAuB,EAAU,EAAO,GACtD,aAAgB,OAAO,KAAK,KAAK,UAAU,CAAE,KAAM,QAAS,MAAO,EAAQ,CAAC,CAAC,CAAC,SAAS,SAAS,CACjG,EAIH,aAAgB,CAAE,KAAM,QAAS,MAAO,EAAQ,EAEhD,aAAgB,SAAS,EAAO,IAAK,GAAM,OAAO,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,GAClE,CAED,OAAO,GAgFI,EAAQ,EA7EuB,GACnC,EAAY,EAAO,CAGL,CAOrB,IAAuB,GAAG,IACjB,EAAY,EAAO,CAS5B,MAAuC,EAAU,IACxC,EAAY,CAAC,EAAO,EAAO,CAAW,CAS/C,QAAyD,EAAU,EAAW,IACrE,EAAY,CAAC,EAAO,EAAQ,EAAM,CAAc,CASzD,UACS,EAAY,EAAE,CAAO,CAQ9B,KAAyB,GAChB,EAAY,EAAO,CAE7B,CAwB+D"}
@@ -1 +0,0 @@
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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