functype logo

functype

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)
12x
Faster List Operations
Tree-Shakeable
Optimized Bundle Size
100%
TypeScript

Why Functype?

A functional programming library designed for TypeScript developers who value type safety and composition

Scala-Style API

Familiar constructor functions with method chaining. Works like Scala's collections API.

High Performance

Do-notation is 12x faster for List comprehensions compared to traditional flatMap chains.

Unified Interfaces

All types implement the same hierarchy of interfaces. Learn once, use everywhere.

Tree-Shakeable

Import only what you need. Optimized for minimal bundle size with selective imports.

Explore the Complete Feature Matrix

See at a glance which functional programming interfaces are supported by each data structure

View Feature Matrix →

Quick Start

Get up and running with functype in minutes

1

Install functype

npm install functype

Also works with yarn, pnpm, and bun

2

Import what you need

import { Option, Either, List } from "functype"

// Or use selective imports for smaller bundles
import { Option } from "functype/option"
3

Start coding functionally

const result = Option(user)
  .map(u => u.email)
  .filter(email => email.includes("@"))
  .getOrElse("no-email@example.com")

Claude Code Skills

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.

Functype User

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.

Pattern conversion examples (imperative → functional)
Quick API reference and method lookup
Common use cases and debugging tips
# Install via marketplace
/plugin install functype-user

Functype Developer

For Library Contributors

Comprehensive guide for contributing to functype. Learn the architecture patterns, create new data structures, implement functional interfaces, and follow library conventions.

Base pattern, HKT system, and Companion utilities
Step-by-step guide for creating new types
Testing patterns and validation scripts
# Install via marketplace
/plugin install functype-developer

Quick Installation

Install functype skills in Claude Code using the marketplace:

# Step 1: Add the functype marketplace
/plugin marketplace add jordanburke/functype
# Step 2: Install the skills you need
/plugin install functype-user
/plugin install functype-developer

Learn more about skills at github.com/jordanburke/functype