Put what can go wrong in the type.
Option, Either, Try, List and IO for TypeScript. Missing values, errors and effects become types your compiler checks, and so does the agent writing your code.
port is a plain number8080PORT="8080" stays a value the whole way down.Four types for the four ways code goes wrong.
Each has a shape for the value and a shape for what happened instead. You handle the problem once, where it makes sense.
The value may not be there.
It failed, and E says how.
The code it ran may throw.
An effect. It needs services R, can fail with E, and runs only when you run it.
Building an IO runs nothing.
greet(id) returns a plan. Build it as often as you like and the lookup count stays at zero. It runs when you run it.
import { IO, Option, Tag } from "functype" type User = { readonly id: string; readonly name: string } class NotFound { readonly _tag = "NotFound" } const Users = Tag<{ readonly find: (id: string) => User | undefined }>("Users") const greet = (id: string) => IO.service(Users) .flatMap((users) => IO.fromOptionOrFail(Option(users.find(id)), () => new NotFound())) .map((u) => `Hello, ${u.name}`) .catchTag("NotFound", () => IO.succeed("Hello, guest"))
Small and fast, measured.
Against Effect 4.1.5 on Node 24, using the published packages.
A million chained steps run without a stack overflow, and there are no runtime dependencies.
Your coding agent reads the same docs.
It can search them, check its own code against the compiler and the linter, and load everything as plain text.
MCP server
validate_code type-checks and lints a snippet before you see it.
npx -y functype-mcp-serverClaude Code plugin
The skills and the MCP server in one install.
/plugin marketplace add jordanburke/functype/plugin install functypeESLint plugin
One preset, and every message names the fix.
npm i -D eslint-plugin-functypeDocs as text
The whole library, for any model that can fetch a URL.
functype.org/llms-full.txt