fp-types-ref
यह क्या करती है
`fp-ts` library के सही types (जैसे Option, Either, Task) चुनने में मदद करता है, ताकि आपका TypeScript code व्यवस्थित रहे। यह खासकर उन स्थितियों में काम आता है जहाँ कोई value शायद न हो, या async operation में error आ सकती हो।
कब इस्तेमाल करें
- ✓Option, Either, Task या TaskEither में से चुनना हो तब।
- ✓`fp-ts` के types इम्पोर्ट करने का तरीका समझ न आ रहा हो तब।
- ✓आम fp-ts patterns के लिए एक छोटी गाइड चाहिए हो तब।
Skill का लिंक
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/fp-types-ref/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“ऐसे function के लिए कौन सा fp-ts type इस्तेमाल करूँ जो async है और फेल भी हो सकता है?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI एक सरल flowchart से आपको चुनने में मदद करता है, यह देखकर कि operation async है या नहीं, फेल हो सकता है या नहीं, और value गायब हो सकती है या नहीं। साथ ही imports और आम patterns के code उदाहरण भी देता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
fp-ts Quick Reference
When to Use
- You need help choosing between
Option,Either,Task,TaskEither, or related fp-ts types. - The task is about imports, decision guidance, or selecting the right abstraction for a TypeScript flow.
- You want a compact reference for common fp-ts type choices and patterns.
Which Type Should I Use?
Is the operation async?
├─ NO: Does it involve errors?
│ ├─ YES → Either<Error, Value>
│ └─ NO: Might value be missing?
│ ├─ YES → Option<Value>
│ └─ NO → Just use the value
└─ YES: Does it involve errors?
├─ YES → TaskEither<Error, Value>
└─ NO: Might value be missing?
├─ YES → TaskOption<Value>
└─ NO → Task<Value>
Common Imports
// Core
import { pipe, flow } from 'fp-ts/function'
// Types
import * as O from 'fp-ts/Option' // Maybe exists
import * as E from 'fp-ts/Either' // Success or failure
import * as TE from 'fp-ts/TaskEither' // Async + failure
import * as T from 'fp-ts/Task' // Lazy async; no typed error channel
import * as A from 'fp-ts/Array' // Array utilities
One-Line Patterns
| Need | Code |
|---|---|
| Wrap nullable | O.fromNullable(value) |
| Default value | O.getOrElse(() => fallbackValue) |
| Transform if exists | O.map(fn) |
| Chain optionals | O.flatMap(fn) |
| Wrap try/catch | E.tryCatch(() => risky(), toError) |
| Wrap async | TE.tryCatch(() => fetch(url), toError) |
| Run pipe | pipe(value, fn1, fn2, fn3) |
Pattern Match
// Option
pipe(maybe, O.match(
() => 'nothing',
(val) => `got ${val}`
))
// Either
pipe(result, E.match(
(err) => `error: ${err}`,
(val) => `success: ${val}`
))
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Reference scope
These are fp-ts 2.x fragments. Supply application variables, types, validators and imports, and check the installed version. map does not catch thrown exceptions. Task has no typed error channel; an improperly wrapped promise can still reject. Use tryCatch at fallible boundaries.
Official API: fp-ts modules.
अक्सर पूछे जाने वाले सवाल
Option, Either और Task क्या हैं?
ये types हैं जो आम प्रोग्रामिंग स्थितियों को ज़्यादा सुरक्षित और व्यवस्थित तरीके से संभालने में मदद करते हैं, जैसे ऐसी value जो शायद न हो (Option), ऐसा operation जो सफल या असफल हो सकता है (Either), और ऐसा operation जिसे पूरा होने में समय लगता है (Task)।
'asynchronous' का क्या मतलब है?
इसका मतलब है कि कोई operation तुरंत नहीं होता, बल्कि भविष्य में किसी समय पर होता है। जैसे server से डेटा लाना या फाइल पढ़ना।
fp-ts क्या है?
यह TypeScript के लिए एक लोकप्रिय library है जो functional programming की अवधारणाएँ लाती है, ताकि मज़बूत और अनुमान लगाने योग्य code लिखा जा सके।
जानकारी
लेखक का मूल विवरण
Quick reference for fp-ts types. Use when user asks which type to use, needs Option/Either/Task decision help, or wants fp-ts imports.
लोकप्रियता
- GitHub स्टार
- 48k
- रैंकिंग में स्थान
- #4652
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
00-andruia-consultant
48kआपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।
007
48kआपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।
10-andruia-skill-smith
48kआपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।
20-andruia-niche-intelligence
48kआपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।