fp-ts-validation
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> =>
More from whatiskadudoing/fp-ts-skills
functional programming fundamentals
Core FP concepts including pure functions, currying, composition, and pointfree style - the foundation for mastering functional TypeScript
81fp-ts-backend
Functional programming patterns for Node.js/Deno backend development using fp-ts, ReaderTaskEither, and functional dependency injection
52pragmatic functional programming
A practical, jargon-free guide to functional programming - the 80/20 approach that gets results without the academic overhead
40functional programming in react
Practical patterns for using fp-ts with React - hooks, state, forms, data fetching. Works with React 18/19, Next.js 14/15.
40fp-immutable
Practical immutability patterns in TypeScript - spread operators, nested updates, readonly types, and when mutation is actually fine
39fp-ts-async-practical
Practical async patterns using TaskEither - clean pipelines instead of try/catch hell, with real API examples
38