fp-ts-validation

Accumulate validation errors in FP-TS using applicative patterns.

11|3|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/whatiskadudoing/fp-ts-skills --skill fp-ts-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fp-ts-validation
Source: https://github.com/whatiskadudoing/fp-ts-skills/tree/main/skills/fp-validation
Command: npx skills add https://github.com/whatiskadudoing/fp-ts-skills --skill fp-ts-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

FP-TS validation code can become verbose and error-prone when validating multiple fields or API payloads. This Skill provides patterns to accumulate all errors and separate schema validation from business rules, improving UX for forms and API validation.

Core Features & Use Cases

  • Error accumulation with fp-ts using NonEmptyArray and applicative validation to report all field errors at once.
  • Compose independent validators for forms and API payloads using sequenceS/sequenceT and io-ts/Zod examples.
  • Real-world use: validate a user registration form or an API request body with structured failures for fields.

Quick Start

Load the fp-ts-validation skill and start by validating a sample payload with the provided validators to observe aggregated errors.

Frequently Asked Questions about fp-ts-validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I accumulate form validation errors in fp-ts instead of stopping at the first failure?

Use NonEmptyArray and applicative validation patterns like sequenceS or sequenceT to compose independent validators, collecting all field errors rather than short-circuiting at the first failure.

What is applicative validation in fp-ts and when do I need it for API payloads?

Applicative validation in fp-ts is a pattern that collects all validation failures independently. You need it for API payloads and form-heavy scenarios to report all field errors at once, improving UX by separating schema validation from business rules.

Can I use fp-ts validation with schema validation libraries like io-ts or Zod?

Yes, you can compose schema validation with fp-ts by integrating io-ts or Zod, separating schema validation from business rules while leveraging sequenceS and sequenceT for structured error accumulation.

How do I validate a user registration form and return structured errors for each field?

Validate a user registration form by composing independent field validators using sequenceS or sequenceT in fp-ts, which aggregates failures into a NonEmptyArray to return structured errors for all invalid fields simultaneously.

Does fp-ts error accumulation work for both form validation and API request bodies?

Yes, fp-ts error accumulation works for both form validation and API request bodies. By using applicative validation patterns, you can collect all structured field failures for any payload scenario rather than stopping at the first error.