Functional programming in TypeScript
Inspired by PureScript, static-land, Scala.
The idea (faking higher kinded types in TypeScript) is based on Lightweight higher-kinded polymorphism
To install the stable version:
npm install --save fp-ts
The stable version is tested against TypeScript 3.2.4, but should run with TypeScript 2.8.0+ too
Note. If you are running < typescript@3.0.1
you have to polyfill unknown
.
You can use unknown-ts as a polyfill.
Note. Make sure to always have a single version of fp-ts
installed in your project. Multiple versions are known to cause tsc
to hang during compilation. You can check the versions currently installed using npm ls fp-ts
(make sure there's a single version and all the others are marked as deduped
).
- fp-ts-codegen - TypeScript code generation from a haskell-like syntax for ADT
- io-ts - TypeScript compatible runtime type system for IO validation
- monocle-ts - Functional optics: a (partial) porting of scala monocle to TypeScript
- newtype-ts - Implementation of newtypes in TypeScript
- logging-ts - Composable loggers for TypeScript
- fp-ts-routing - A type-safe bidirectional routing library for TypeScript
- parser-ts - String parser combinators for TypeScript
- remote-data-ts - RemoteData type (check this article)
- retry-ts - Retry combinators for monadic actions that may fail
- fp-ts-local-storage - fp-ts bindings for LocalStorage
- circuit-breaker-monad - Circuit Breaker pattern as a monad
- fp-ts-rxjs - fp-ts bindings for RxJS
- fp-ts-fluture - fp-ts bindings for Fluture
- fp-ts-most - fp-ts bindings for @most/core
- Free monad
- MTL-style
- OptionT monad transformer
- EitherT monad transformer
- StateT monad transformer
- Reader monad
- ReaderT monad transformer
- Applicative composition
- Type safe finite state machines with
IxIO
- Moore machines
- Debugging with
Trace
- fantas-eel-and-specification - Code for the Fantas, Eel, and Specification blog series on functional programming by Tom Harding
The MIT License (MIT)