A modular implementation of Haskell's Prelude for modern JavaScript.
It ships as native ESM, runs on Bun or Node 20+, and keeps the runtime source in src/ without a generated CommonJS dist in the repo.
- Small, composable helpers that feel close to Prelude semantics.
- Direct module and deep-function exports for focused imports.
- Bun-first tooling for install, test, docs, and generator workflows.
bun add preludejsnpm install preludejsimport { List, Func, General } from 'preludejs'
import map from 'preludejs/List/map'
List.length([1, 2, 3]) // 3
List.elem(2, [1, 2, 3]) // true
Func.const('left', 'right') // 'left'
General.snd(['first', 'second']) // 'second'
map((x) => x * 2, [1, 2, 3]) // [2, 4, 6]bun install
bun run check
bun run docspreludejsresolves tosrc/index.js.preludejsexposes named module namespaces likeList,Func,Obj, and friends.preludejs/List,preludejs/Func,preludejs/Obj, and the other module subpaths are exported directly.- Deep imports such as
preludejs/List/mapare also exported for consumers that want single-function entrypoints. - Legacy generated module folders are not stored in the repository root.
See docs/README.md for the module reference.
