MR
Mayur Rathi
@whatiskadudoing
⭐ 40.7k GitHub stars

Fp Ts Pragmatic

Fp Ts Pragmatic is an writing AI skill with a core value of A practical, jargon-free guide to fp-ts functional programming - the 80/20 approach that gets results without the academic overhead. It helps developers solve real-world problems in the writing domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

A practical, jargon-free guide to fp-ts functional programming - the 80/20 approach that gets results without the academic overhead. Use when writing TypeScript with fp-ts library.

Last verified on: 2026-07-08

Quick Facts

Category writing
Works With Claude
Source sickn33/antigravity-awesome-skills
Stars ⭐ 40.7k
Last Verified 2026-07-08
Risk Level Low
mkdir -p ./skills/fp-ts-pragmatic && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/fp-ts-pragmatic/SKILL.md -o ./skills/fp-ts-pragmatic/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# Pragmatic Functional Programming


**Read this first.** This guide cuts through the academic jargon and shows you what actually matters. No category theory. No abstract nonsense. Just patterns that make your code better.


When to Use This Skill


- When starting with fp-ts and need practical guidance

- When writing TypeScript code that handles nullable values, errors, or async operations

- When you want cleaner, more maintainable functional code without the academic overhead

- When refactoring imperative code to functional style


The Golden Rule


> **If functional programming makes your code harder to read, don't use it.**


FP is a tool, not a religion. Use it when it helps. Skip it when it doesn't.


---


The 80/20 of FP


These five patterns give you most of the benefits. Master these before exploring anything else.


1. Pipe: Chain Operations Clearly


Instead of nesting function calls or creating intermediate variables, chain operations in reading order.


typescript
import { pipe } from 'fp-ts/function'

// Before: Hard to read (inside-out)
const result = format(validate(parse(input)))

// Before: Too many variables
const parsed = parse(input)
const validated = validate(parsed)
const result = format(validated)

// After: Clear, linear flow
const result = pipe(
  input,
  parse,
  validate,
  format
)

**When to use pipe:**

- 3+ transformations on the same data

- You find yourself naming throwaway variables

- Logic reads better top-to-bottom


**When to skip pipe:**

- Just 1-2 operations (direct call is fine)

- The operations don't naturally chain


2. Option: Handle Missing Values Without null Checks


Stop writing `if (x !== null && x !== undefined)` everywhere.


typescript
import * as O from 'fp-ts/Option'
import { pipe } from 'fp-ts/function'

// Before: Defensive null checking
function getUserCity(user: User | null): string {
  if (user === null) return 'Unknown'
  if (user.address === null) return 'Unknown'
  if (user.address.city === null) return 'Unknown'
  return user.address.city
}

// After: Chain through potential missing values
const getUserCity = (user: User | null): string =>
  pipe(
    O.fromNullable(user),
    O.flatMap(u => O.fromNullable(u.address)),
    O.flatMap(a => O.fromNullable(a.city)),
    O.getOrElse(() => 'Unknown')
  )

**Plain language translation:**

- `O.fromNullable(x)` = "wrap this value, treating null/undefined as 'nothing'"

- `O.flatMap(fn)` = "if we have something, apply this function"

- `O.getOrElse(() => default)` = "unwrap, or use this default if nothing"


3. Either: Make Errors Explicit


Stop throwing exceptions for expected failures. Return errors as values.


typescript
import * as E from 'fp-ts/Either'
import { pipe } from 'fp-ts/function'

// Before: Hidden failure mode
function parseAge(input: string): number {
  const age = parseInt(input, 10)
  if (isNaN(age)) throw new Error('Invalid age')
  if (age < 0) throw new Error('Age cannot be negative')
  return age
}

// After: Errors are visible in the type
function parseAge(input: string): E.Either<string, number> {
  const age = parseInt(input, 10)
  if (isNaN(age)) return E.left('Invalid age')
  if (age < 0) return E.left('Age cannot be negative')
  return E.right(age)
}

// Using it
const result = parseAge(userInput)
if (E.isRight(result)) {
  console.log(`Age is ${result.right}`)
} else {
  console.log(`Error: ${result.left}`)
}

**Plain language translation:**

- `E.right(value)` = "success with this value"

- `E.left(error)` = "failure with this error"

- `E.isRight(x)` = "did it succeed?"


4. Map: Transform Without Unpacking


Transform values inside containers without extracting them first.


typescript
import * as O from 'fp-ts/Option'
import * as E from 'fp-ts/Either'
import * as A from 'fp-ts/Array'
import { pipe } from 'fp-ts/function'

// Transform inside Option
const maybeUser: O.Option<User> = O.some({ name: 'Alice', age: 30 })
const maybeName: O.Option<string> = pipe(
  maybeUse

🎯 Best For

  • UI designers
  • Product designers
  • Claude users
  • Content creators
  • Writers

💡 Use Cases

  • Generating component mockups
  • Creating design system tokens
  • Content creation
  • Style guide enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Fp Ts Pragmatic to Your Work

    Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.

  4. 4

    Review and Refine

    Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.

❓ Frequently Asked Questions

Does this work with Figma?

Some design skills integrate with Figma plugins. Check the Works With section for supported tools.

Can Fp Ts Pragmatic maintain my brand voice?

Yes — provide style guides or example content in your prompt for consistent brand-aligned output.

How do I install Fp Ts Pragmatic?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/fp-ts-pragmatic/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping usability testing

AI-generated designs should be validated with real users before development.

Publishing unedited drafts

AI writing needs human editing for facts, flow, and authentic voice.

🔗 Related Skills