/fp-ts

Functional programming in TypeScript

Primary LanguageTypeScriptMIT LicenseMIT

build status dependency status npm downloads

Inspired by

Installation

To install the stable version:

npm install --save fp-ts

TypeScript compatibility

The stable version is tested against TypeScript 2.7.x, but should run with TypeScript 2.2.2+ too

Technical overview

The idea (faking higher kinded types in TypeScript) is based on

Ecosystem

  • 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)

Bindings

Documentation

Internals

Examples

Note. You can run the examples using ts-node with tsconfig-paths

$ cd examples
$ ts-node -r tsconfig-paths/register debugging-with-Trace.ts

License

The MIT License (MIT)