fp-ts-validation

Installation
SKILL.md

fp-ts Validation Patterns

This skill covers validation patterns using fp-ts, focusing on error accumulation, form validation, and API input validation.

Core Concepts

Either for Validation

Either<E, A> represents a computation that can fail with error E or succeed with value A.

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

// Basic validation function signature
type Validation<E, A> = E.Either<E, A>

// Simple validation returning Either
const validateNonEmpty = (field: string) => (value: string): E.Either<string, string> =>
Related skills
Installs
39
GitHub Stars
6
First Seen
Jan 31, 2026