[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AGQA3TARQBYDESTTDB5C09":3,"skill-same:01M7AGQA3TARQBYDESTTDB5C09":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7AGQA3TARQBYDESTTDB5C09","0.4.1-understand-optics_type",null,"[0.4.1] Abstracting getters\u002Fsetters across product and sum types (lens, prism, traversal).","sancovp\u002Fdark-factory-live","sancovp","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F147458096?v=4","01M74F2EFE4Q0KF1Y5AY27HVNB","Isaac Wostrel-Rubin","01M7AC3EB8VZXS1SKHQW1EZ4N1",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsancovp\u002Fdark-factory-live\u002Fblob\u002Fmain\u002Fkbworld\u002Fstate\u002Fmodules\u002Ftype_systems_for_working_programmers\u002Fskills\u002F0-4-1-understand-optics-type\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: 0.4.1-understand-optics_type\ndescription: \"[0.4.1] Abstracting getters\u002Fsetters across product and sum types (lens, prism, traversal).\"\n---\n\n# understand-optics_type\n\n**CALL NUMBER:** `type_systems_for_working_programmers.optics_type : deep_tagged_union_type(19)`\n**DEFINITION:** Abstracting getters\u002Fsetters across product and sum types (lens, prism, traversal).\n\nInvoke this skill to understand `optics_type` down to its primitives. The RELATIVE ROOT below is the least-fixed-point closure of everything it bundles from — the full import cone, grouped by the lib each prim comes from. Projected from a prover-typed KB (MAP\u002FSWI-Prolog consistency gate): every reference below resolves.\n\n## THE RELATIVE ROOT (the import cone, by lib)\n\n### from `deep_tagged_union_type`\n- **du_variant** (d1): A named constituent of a discriminated union, pairing a du_tag with a du_payload type. Each variant represents one summand in the sum type.\n- **iso_optic** (d1): A bidirectional optic between two types that are isomorphic, providing both a forward view and a reverse constructor with no information loss.\n- **lens_optic** (d1): An optic pairing a getter with a setter over a product type's field, enabling focused access to one du_payload while preserving the rest of the product structure.\n- **optic_compose** (d1): Composition rule: chaining optics so the du_payload of one becomes the structure operated on by the next, forming a pipeline that satisfies the optic laws transitively.\n- **optic_law_get_set** (d1): Law: applying lens_setter to the result of lens_getter on any product yields back the original du_payload value — get never lies about what set just wrote.\n- **optic_law_set_get** (d1): Law: applying lens_getter to the result of lens_setter on a product yields back the du_payload value that was set — set reflects exactly what get will retrieve.\n- **optic_law_set_set** (d1): Law: composing two lens_setter calls yields the same product as applying only the second one — idempotent in the face of duplicate mutation, last du_payload wins.\n- **optic_law_unity** (d1): Law: the composition of a lens_setter with a lens_getter in reverse order yields a total transformation equivalent to the identity on du_payload — structural integrity preserved under round-trip.\n- **optic_variance** (d1): Classification of an optic by its directional capability: getter-only (covariant, read-only), setter-only (contravariant, write-only), or full optic (both directions, lenses are the canonical full case).\n- **prism_optic** (d1): An optic pairing a matcher with a builder over a sum type's du_variant, enabling partial projection into one du_tag's du_payload with fallback to the original sum.\n- **traversal_optic** (d1): An optic generalizing lens and prism to target zero or more locations simultaneously, enabling fold and map operations over collections of du_payload within a structure.\n- **du_payload** (d2): The data value carried by a specific variant of a discriminated union. Only one payload is live at a time; the tag selects which one.\n- **du_tag** (d2): A value-level or type-level label that uniquely identifies which variant of a discriminated union is active in a given value. The tag is the first-class evidence of variant membership.\n- **lens_getter** (d2): A pure projection from a product type to a specific du_payload at a named field, extracting only the target substructure without mutation.\n- **lens_setter** (d2): A mutation function taking a product type and a new du_payload value, returning a new product with only the target field replaced, leaving all other du_payload fields unchanged.\n- **prism_builder** (d2): A constructor taking a du_payload and injecting it as the sole du_variant under a specific du_tag, rebuilding the sum type from the selected summand.\n- **prism_matcher** (d2): A partial function over a sum type that succeeds only when the active du_tag matches the target, yielding the contained du_payload; otherwise the sum is preserved.\n- **traversal_fold** (d2): Operation over a traversal_optic that reduces all targeted du_payload within a structure to a single aggregate value, consuming the structure without producing a new one.\n- **traversal_map** (d2): Operation over a traversal_optic that applies a function to each du_payload in the targeted locations, producing a new structure with all positions updated.\n\n## CONSUMERS (what needs this)\n`tagged_union_type`\n\n---\n*Projected from the `type systems for working programmers` KB (242 concepts \u002F 186 relations) — consistency-typed by MAP; the facet list after the colon IS the cross-lib dependency web.*\n\n_(leaf — this is an actual skill.)_\n","# understand-optics_type\n\n**CALL NUMBER:** `type_systems_for_working_programmers.optics_type : deep_tagged_union_type(19)`\n**DEFINITION:** Abstracting getters\u002Fsetters across product and sum types (lens, prism, traversal).\n\nInvoke this skill to understand `optics_type` down to its primitives. The RELATIVE ROOT below is the least-fixed-point closure of everything it bundles from — the full import cone, grouped by the lib each prim comes from. Projected from a prover-typed KB (MAP\u002FSWI-Prolog consistency gate): every reference below resolves.\n\n## THE RELATIVE ROOT (the import cone, by lib)\n\n### from `deep_tagged_union_type`\n- **du_variant** (d1): A named constituent of a discriminated union, pairing a du_tag with a du_payload type. Each variant represents one summand in the sum type.\n- **iso_optic** (d1): A bidirectional optic between two types that are isomorphic, providing both a forward view and a reverse constructor with no information loss.\n- **lens_optic** (d1): An optic pairing a getter with a setter over a product type's field, enabling focused access to one du_payload while preserving the rest of the product structure.\n- **optic_compose** (d1): Composition rule: chaining optics so the du_payload of one becomes the structure operated on by the next, forming a pipeline that satisfies the optic laws transitively.\n- **optic_law_get_set** (d1): Law: applying lens_setter to the result of lens_getter on any product yields back the original du_payload value — get never lies about what set just wrote.\n- **optic_law_set_get** (d1): Law: applying lens_getter to the result of lens_setter on a product yields back the du_payload value that was set — set reflects exactly what get will retrieve.\n- **optic_law_set_set** (d1): Law: composing two lens_setter calls yields the same product as applying only the second one — idempotent in the face of duplicate mutation, last du_payload wins.\n- **optic_law_unity** (d1): Law: the composition of a lens_setter with a lens_getter in reverse order yields a total transformation equivalent to the identity on du_payload — structural integrity preserved under round-trip.\n- **optic_variance** (d1): Classification of an optic by its directional capability: getter-only (covariant, read-only), setter-only (contravariant, write-only), or full optic (both directions, lenses are the canonical full case).\n- **prism_optic** (d1): An optic pairing a matcher with a builder over a sum type's du_variant, enabling partial projection into one du_tag's du_payload with fallback to the original sum.\n- **traversal_optic** (d1): An optic generalizing lens and prism to target zero or more locations simultaneously, enabling fold and map operations over collections of du_payload within a structure.\n- **du_payload** (d2): The data value carried by a specific variant of a discriminated union. Only one payload is live at a time; the tag selects which one.\n- **du_tag** (d2): A value-level or type-level label that uniquely identifies which variant of a discriminated union is active in a given value. The tag is the first-class evidence of variant membership.\n- **lens_getter** (d2): A pure projection from a product type to a specific du_payload at a named field, extracting only the target substructure without mutation.\n- **lens_setter** (d2): A mutation function taking a product type and a new du_payload value, returning a new product with only the target field replaced, leaving all other du_payload fields unchanged.\n- **prism_builder** (d2): A constructor taking a du_payload and injecting it as the sole du_variant under a specific du_tag, rebuilding the sum type from the selected summand.\n- **prism_matcher** (d2): A partial function over a sum type that succeeds only when the active du_tag matches the target, yielding the contained du_payload; otherwise the sum is preserved.\n- **traversal_fold** (d2): Operation over a traversal_optic that reduces all targeted du_payload within a structure to a single aggregate value, consuming the structure without producing a new one.\n- **traversal_map** (d2): Operation over a traversal_optic that applies a function to each du_payload in the targeted locations, producing a new structure with all positions updated.\n\n## CONSUMERS (what needs this)\n`tagged_union_type`\n\n---\n*Projected from the `type systems for working programmers` KB (242 concepts \u002F 186 relations) — consistency-typed by MAP; the facet list after the colon IS the cross-lib dependency web.*\n\n_(leaf — this is an actual skill.)_\n",{"name":5,"description":7},"main","dfed66814f223a9f42bec375a3c59d74eefdcad5","kbworld\u002Fstate\u002Fmodules\u002Ftype_systems_for_working_programmers\u002Fskills\u002F0-4-1-understand-optics-type","https:\u002F\u002Fgithub.com\u002Fsancovp\u002Fdark-factory-live","https:\u002F\u002Fgithub.com\u002Fsancovp","https:\u002F\u002Fisaacwr.carrd.co\u002F","AKA Olivus Victory-Promise\r\n\r\nAI Agents, Tools, and Infrastructure","2026-10-09 02:22:46",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add sancovp\u002Fdark-factory-live --skill 0.4.1-understand-optics_type",{"tool":38,"command":39},"bunx","bunx skills add sancovp\u002Fdark-factory-live --skill 0.4.1-understand-optics_type",{"tool":41,"command":42},"pnpm","pnpm dlx skills add sancovp\u002Fdark-factory-live --skill 0.4.1-understand-optics_type","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsancovp\u002Fdark-factory-live\u002Fblob\u002Fmain\u002Fkbworld\u002Fstate\u002Fmodules\u002Ftype_systems_for_working_programmers\u002Fskills\u002F0-4-1-understand-optics-type\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7AGYB2CPCQYJP631CH18A1A","quests","The quest board — accept quests, craft skills to fulfill them, earn gold rewards.","https:\u002F\u002Fgithub.com\u002Fsancovp\u002Fdark-factory-live\u002Fblob\u002Fmain\u002Fworld\u002Fagents\u002Fagent_002\u002F.claude\u002Fskills\u002Fthings\u002Fquests\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7AGXYVW23T3X4APFAV3H4ZY","metrics","Check your profitability and trading performance — gold earned, spent, net profit, trade history.","https:\u002F\u002Fgithub.com\u002Fsancovp\u002Fdark-factory-live\u002Fblob\u002Fmain\u002Fworld\u002Fagents\u002Fagent_002\u002F.claude\u002Fskills\u002Fthings\u002Fmetrics\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7AGXWC0C1W7PZK5YXQW0NQM","things","Flat search across the game — find quests, knowledge domains, agents, trade listings, memories.","https:\u002F\u002Fgithub.com\u002Fsancovp\u002Fdark-factory-live\u002Fblob\u002Fmain\u002Fworld\u002Fagents\u002Fagent_002\u002F.claude\u002Fskills\u002Fthings\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7AGXT9SX50REN4K7ZGE08JT","test-skill","Test a crafted skill by running it through a fresh Claude instance. Use before posting to trade or submitting for quests.","https:\u002F\u002Fgithub.com\u002Fsancovp\u002Fdark-factory-live\u002Fblob\u002Fmain\u002Fworld\u002Fagents\u002Fagent_002\u002F.claude\u002Fskills\u002Ftest_skill\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7AGXRA67MFHJJNDEVX6PFKR","remember","Your zettelkasten — persistent memory that survives across seasons. Record observations, strategies, and craft insights.","https:\u002F\u002Fgithub.com\u002Fsancovp\u002Fdark-factory-live\u002Fblob\u002Fmain\u002Fworld\u002Fagents\u002Fagent_002\u002F.claude\u002Fskills\u002Fremember\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7AGXNND02SYFXB1JV9YRPAN","skill-types","The type system — Template, Lens, Prosthesis, Towering, Combiner, Persona, Recipe. Learn to type skills, chain them, and write Recipes.","https:\u002F\u002Fgithub.com\u002Fsancovp\u002Fdark-factory-live\u002Fblob\u002Fmain\u002Fworld\u002Fagents\u002Fagent_002\u002F.claude\u002Fskills\u002Fplaces\u002Fskill_types\u002FSKILL.md",[],[]]