[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71630182KM52MDC8Y333N1M":3,"skill-same:01M71630182KM52MDC8Y333N1M":66},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":14,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":51,"install":52,"resources":65},"01M71630182KM52MDC8Y333N1M","fp-either-ref",null,"Quick reference for Either type. Use when user needs error handling, validation, or operations that can fail with typed errors.","sapsapshen\u002Fai-memory-router","sapsapshen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F20347959?v=4","01M6XDQEF1DP50DKF37H81J3J5","shenmian","01M6XDQEJPE41Y3DT2763X8ZJN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffp-either-ref\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"fp either ref","either","validation","operations","with","type","error handling","can","unknown","when","quick-reference","error-handling","use","errors","for","quick reference","quick","community","fp-ts","error","2026-11-10 10:12:30",false,"---\nname: fp-either-ref\ndescription: Quick reference for Either type. Use when user needs error handling, validation, or operations that can fail with typed errors.\nrisk: unknown\nsource: community\nversion: 1.0.0\ntags: [fp-ts, either, error-handling, validation, quick-reference]\n---\n\n# Either Quick Reference\n\nEither = success or failure. `Right(value)` or `Left(error)`.\n\n## Create\n\n```typescript\nimport * as E from 'fp-ts\u002FEither'\n\nE.right(value)           \u002F\u002F Success\nE.left(error)            \u002F\u002F Failure\nE.fromNullable(err)(x)   \u002F\u002F null → Left(err), else Right(x)\nE.tryCatch(fn, toError)  \u002F\u002F try\u002Fcatch → Either\n```\n\n## Transform\n\n```typescript\nE.map(fn)                \u002F\u002F Transform Right value\nE.mapLeft(fn)            \u002F\u002F Transform Left error\nE.flatMap(fn)            \u002F\u002F Chain (fn returns Either)\nE.filterOrElse(pred, toErr) \u002F\u002F Right → Left if pred fails\n```\n\n## Extract\n\n```typescript\nE.getOrElse(err => default)  \u002F\u002F Get Right or default\nE.match(onLeft, onRight)     \u002F\u002F Pattern match\nE.toUnion(either)            \u002F\u002F E | A (loses type info)\n```\n\n## Common Patterns\n\n```typescript\nimport { pipe } from 'fp-ts\u002Ffunction'\nimport * as E from 'fp-ts\u002FEither'\n\n\u002F\u002F Validation\nconst validateEmail = (s: string): E.Either\u003Cstring, string> =>\n  s.includes('@') ? E.right(s) : E.left('Invalid email')\n\n\u002F\u002F Chain validations (stops at first error)\npipe(\n  E.right({ email: 'test@example.com', age: 25 }),\n  E.flatMap(d => pipe(validateEmail(d.email), E.map(() => d))),\n  E.flatMap(d => d.age >= 18 ? E.right(d) : E.left('Must be 18+'))\n)\n\n\u002F\u002F Convert throwing code\nconst parseJson = (s: string) => E.tryCatch(\n  () => JSON.parse(s),\n  (e) => `Parse error: ${e}`\n)\n```\n\n## vs try\u002Fcatch\n\n```typescript\n\u002F\u002F ❌ try\u002Fcatch - errors not in types\ntry {\n  const data = JSON.parse(input)\n  process(data)\n} catch (e) {\n  handleError(e)\n}\n\n\u002F\u002F ✅ Either - errors explicit in types\npipe(\n  E.tryCatch(() => JSON.parse(input), String),\n  E.map(process),\n  E.match(handleError, identity)\n)\n```\n\nUse Either when **error type matters** and you want to chain operations.\n","# Either Quick Reference\n\nEither = success or failure. `Right(value)` or `Left(error)`.\n\n## Create\n\n```typescript\nimport * as E from 'fp-ts\u002FEither'\n\nE.right(value)           \u002F\u002F Success\nE.left(error)            \u002F\u002F Failure\nE.fromNullable(err)(x)   \u002F\u002F null → Left(err), else Right(x)\nE.tryCatch(fn, toError)  \u002F\u002F try\u002Fcatch → Either\n```\n\n## Transform\n\n```typescript\nE.map(fn)                \u002F\u002F Transform Right value\nE.mapLeft(fn)            \u002F\u002F Transform Left error\nE.flatMap(fn)            \u002F\u002F Chain (fn returns Either)\nE.filterOrElse(pred, toErr) \u002F\u002F Right → Left if pred fails\n```\n\n## Extract\n\n```typescript\nE.getOrElse(err => default)  \u002F\u002F Get Right or default\nE.match(onLeft, onRight)     \u002F\u002F Pattern match\nE.toUnion(either)            \u002F\u002F E | A (loses type info)\n```\n\n## Common Patterns\n\n```typescript\nimport { pipe } from 'fp-ts\u002Ffunction'\nimport * as E from 'fp-ts\u002FEither'\n\n\u002F\u002F Validation\nconst validateEmail = (s: string): E.Either\u003Cstring, string> =>\n  s.includes('@') ? E.right(s) : E.left('Invalid email')\n\n\u002F\u002F Chain validations (stops at first error)\npipe(\n  E.right({ email: 'test@example.com', age: 25 }),\n  E.flatMap(d => pipe(validateEmail(d.email), E.map(() => d))),\n  E.flatMap(d => d.age >= 18 ? E.right(d) : E.left('Must be 18+'))\n)\n\n\u002F\u002F Convert throwing code\nconst parseJson = (s: string) => E.tryCatch(\n  () => JSON.parse(s),\n  (e) => `Parse error: ${e}`\n)\n```\n\n## vs try\u002Fcatch\n\n```typescript\n\u002F\u002F ❌ try\u002Fcatch - errors not in types\ntry {\n  const data = JSON.parse(input)\n  process(data)\n} catch (e) {\n  handleError(e)\n}\n\n\u002F\u002F ✅ Either - errors explicit in types\npipe(\n  E.tryCatch(() => JSON.parse(input), String),\n  E.map(process),\n  E.match(handleError, identity)\n)\n```\n\nUse Either when **error type matters** and you want to chain operations.\n",{"name":5,"risk":27,"tags":44,"source":36,"version":45,"description":7},[37,20,30,21,29],"1.0.0","main","7a38d8e7073e61c16eda85681cb32fb68a8657a5","skills-store\u002Fcursor\u002Ffp-either-ref","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router","https:\u002F\u002Fgithub.com\u002Fsapsapshen","2026-04-14 21:12:12",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add sapsapshen\u002Fai-memory-router --skill fp-either-ref",{"tool":58,"command":59},"bunx","bunx skills add sapsapshen\u002Fai-memory-router --skill fp-either-ref",{"tool":61,"command":62},"pnpm","pnpm dlx skills add sapsapshen\u002Fai-memory-router --skill fp-either-ref","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffp-either-ref\u002FSKILL.md",true,[],[67,77,84,92,98,106],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":72,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":76},"01M72R8PZX1ABFHJGTYPA4CAF1","webapp-testing","To test local web applications, write native Python Playwright scripts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fwebapp-testing\u002FSKILL.md",[],[],"2026-11-10 22:39:42",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":76},"01M72QG37MMZNDY7X7GXPAK5W6","python-packaging","Comprehensive guide to creating, structuring, and distributing Python packages using modern packaging tools, pyproject.toml, and publishing to PyPI.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fpython-packaging\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":76},"01M72NXR0QMP9G46TW6A2DH59C","canvas-design","These are instructions for creating design philosophies - aesthetic movements that are then EXPRESSED VISUALLY. Output only .md files, .pdf files, and .png files.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fcanvas-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fglobal\u002Fcanvas-design\u002FSKILL.md",[],[],{"skillNo":93,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":94,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":76},"01M72N55TK3EEQ4QK4AWDC2KZS","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":102,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":76},"01M72MTWC150CFAP4Y5GSNKF80","slack-gif-creator","A toolkit providing utilities and knowledge for creating animated GIFs optimized for Slack.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Fslack-gif-creator\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":71,"licenseFileUrl":110,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":76},"01M72KPT3VVNSP88MNAY466TZT","frontend-design","You are a frontend designer-engineer, not a layout generator.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcursor\u002Ffrontend-design\u002FSKILL.md",[],[]]