Skills and MCP tools for the functype functional programming library for TypeScript
npx claudepluginhub jordanburke/functypeFunctional programming library for TypeScript providing Scala-inspired abstractions for type-safe, composable code.
Official prompts.chat marketplace - AI prompts, skills, and tools for Claude Code
Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations
Claude Code plugins for the Slidev presentation framework
Functype is a lightweight functional programming library for TypeScript, drawing inspiration from functional programming paradigms, the Scala Standard Library, and ZIO. It provides a comprehensive set of utilities and abstractions designed to facilitate functional programming within TypeScript applications.
Get LLM-optimized API reference directly in your terminal:
npx functype # Overview of all types
npx functype Option # Detailed info for Option type
npx functype interfaces # All interface definitions
npx functype --json # JSON output for programmatic use
Some and None typesLeft and Right# NPM
npm install functype
# Yarn
yarn add functype
# PNPM
pnpm add functype
# Bun
bun add functype
Functype is optimized for tree-shaking and offers multiple import strategies to minimize bundle size:
// Selective module imports (recommended for production)
import { Option } from "functype/option"
import { Either } from "functype/either"
// Direct constructor imports (smallest bundle)
import { some, none } from "functype/option"
For detailed optimization strategies, see the Bundle Optimization Guide.
{@includeCode test/docs/documentation-examples.spec.ts#readme-option-basic}
{@includeCode test/docs/documentation-examples.spec.ts#readme-either-basic}
import { List } from "functype"
const numbers = List([1, 2, 3, 4])
// Transform
const doubled = numbers.map((x) => x * 2) // List([2, 4, 6, 8])
// Filter
const evens = numbers.filter((x) => x % 2 === 0) // List([2, 4])
// Reduce
const sum = numbers.foldLeft(0)((acc, x) => acc + x) // 10
// Add/remove elements (immutably)
const withFive = numbers.add(5) // List([1, 2, 3, 4, 5])
const without3 = numbers.remove(3) // List([1, 2, 4])
// Universal container operations
const hasEven = numbers.exists((x) => x % 2 === 0) // true
const firstEven = numbers.find((x) => x % 2 === 0) // Some(2)
const evenCount = numbers.count((x) => x % 2 === 0) // 2
import { Try } from "functype"
// Safely execute code that might throw
const result = Try(() => {
// Potentially throwing operation
return JSON.parse('{"name": "John"}')
})
// Handle success/failure
if (result.isSuccess()) {
console.log("Result:", result.get())
} else {
console.error("Error:", result.error)
}
// Transform with map (only applies on Success)
const name = result.map((obj) => obj.name)
// Convert to Either
const either = result.toEither()
import { Lazy } from "functype"
// Create lazy computations
const expensive = Lazy(() => {
console.log("Computing...")
return Math.random() * 1000
})