Scala-Inspired Functional Programming for TypeScript
Type-safe, immutable, and composable data structures with unified interfaces
import { Option, Either } from "functype"
// Handle null safety with Option
const user = Option(maybeUser)
.map(u => u.name)
.getOrElse("Guest")
// Elegant error handling with Either
const result = Either
.fromTry(() => JSON.parse(data))
.map(obj => obj.value)A functional programming library designed for TypeScript developers who value type safety and composition
Familiar constructor functions with method chaining. Works like Scala's collections API.
Do-notation is 12x faster for List comprehensions compared to traditional flatMap chains.
All types implement the same hierarchy of interfaces. Learn once, use everywhere.
Import only what you need. Optimized for minimal bundle size with selective imports.
See at a glance which functional programming interfaces are supported by each data structure
View Feature Matrix →Explore the foundational types that power functional programming in TypeScript
Safe handling of nullable values with Some and None
Express success/failure with Left and Right values
Immutable arrays with functional operations
Async operations with cancellation and error handling
Scala-like for-comprehensions for monadic composition
Powerful pattern matching and conditional expressions
Get up and running with functype in minutes
npm install functypeAlso works with yarn, pnpm, and bun
import { Option, Either, List } from "functype"
// Or use selective imports for smaller bundles
import { Option } from "functype/option"const result = Option(user)
.map(u => u.email)
.filter(email => email.includes("@"))
.getOrElse("no-email@example.com")Ready to learn more?
AI-powered development tools to accelerate your functype workflow. Install these skills in Claude Code for intelligent code assistance, pattern conversion, and library contribution guidance.
For Application Developers
Transform imperative TypeScript code to functional patterns with AI guidance. Get instant pattern suggestions, API lookups, and debugging help while working with Option, Either, List, and more.
For Library Contributors
Comprehensive guide for contributing to functype. Learn the architecture patterns, create new data structures, implement functional interfaces, and follow library conventions.
Install functype skills in Claude Code using the marketplace:
Learn more about skills at github.com/jordanburke/functype