modular · curried · functional-prelude

prelude-js

A modular, tree-shaking friendly implementation of Haskell's Prelude library in modern JavaScript.

import  from 'preludejs/Func/compose'
import  from 'preludejs/Func/curry'
const  = ((: number, : number) =>  + )
const  = (: number) =>  * 2

// Compose runs right-to-left (double after add(2))
const  = (, (2))

const result = (3) // => 10
const result: number

Curried by Default

Multi-argument functions are curried out of the box to make function composition and point-free style effortless.

Fully Typed

Shipped with clean TypeScript (.d.ts) declaration files. Get full type safety and IDE autocomplete in JS/TS.

Functional Composition

Compose operations cleanly with right-to-left compose, Y-combinator fix, memoization, flip, and more.

Tree-Shaking Friendly

Zero external dependencies. Every utility lives in its own file, allowing bundlers to drop unused helpers.