ft

fp-ts

Functional programming in TypeScript

Showing:

Popularity

Downloads/wk

481K

GitHub Stars

7K

Maintenance

Last Commit

9d ago

Contributors

119

Package

Dependencies

0

License

MIT

Type Definitions

Built-In

Tree-Shakeable

Yes?

Reviews

Average Rating

4.6/57
Read All Reviews
parimalyeole1
Miaxos
rajrgb

Top Feedback

3Bleeding Edge
1Highly Customizable
1Hard to Use

Readme

Functional programming in TypeScript

build status dependency status npm downloads

Typed functional programming in TypeScript

fp-ts is a library for typed functional programming in TypeScript.

fp-ts aims to allow developers to use popular patterns and abstractions that are available in most functional languages. For this, it includes the most popular data types, type classes and abstractions such as Option, Either, IO, Task, Functor, Applicative, Monad to empower users to write pure FP apps and libraries built atop higher order abstractions.

A distinctive feature of fp-ts with respect to other functional libraries is its implementation of Higher Kinded Types, which TypeScript doesn't support natively.

Inspired by

Installation

To install the stable version:

npm install fp-ts

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

TypeScript compatibility

Strictness – This library is conceived, tested and is supposed to be consumed by TypeScript with the strict flag turned on.

fp-ts versionrequired typescript version
2.0.x+3.5+
1.15.x+3.1+
<= 1.14.42.8+ (*)

(*) If you are running < typescript@3.0.1 you have to polyfill the unknown type. You can use unknown-ts as a polyfill.

Documentation

Disclaimer. Teaching functional programming is out of scope of this project, so the documentation assumes you already know what FP is.

Help

If you need help with fp-ts check out:

Development

License

The MIT License (MIT)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable1
Bleeding Edge3
Responsive Maintainers0
Poor Documentation0
Hard to Use1
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
Parimal YeolePune73 Ratings81 Reviews
Lang :Node[TS,JS] | Dart | Go | Haskell DB: Mongo | Postgres | Redis | DynamoDb | ElasticSearch Acrhitecture: Micro-service | Serverless AWS Certified
7 months ago
Bleeding Edge
Highly Customizable

I had little experience with Haskell for functional programming but wanted to bring the same to javascript. But the issue with javascript is that it isn't a typed language. I found fp-ts while reading the book “mostly-adequate-guide”. Fp-ts has all type classes like monads, applicative and functor. I have to warn you though, fp-ts is not simple (basically FP isn't simple) and documentation is not that helpful if you want to learn. But to solve my purpose I can use IO and other monads with ease from Haskell world with my favorite lang typescript for fun.


0
Anthony GriffonFrance1 Rating1 Review
🦀 | Founder @Gobann | Freelance @znly | ex-Software Engineer @iadvize | Co-organizer ReactNantes | Love Rust / FP / GQL Like React / Typescript
4 months ago
Bleeding Edge

Incredible library! I have used it at my previous job, I was so impressed with the functional world that I introduced another engineer and together we changed the entire front-end stack to include functional via fp-ts.


0
rajrgb38 Ratings60 Reviews
FullStack Web Developer MERN Stack, SQL, C/C++
4 months ago

It was little confusing when I first tried it and also didn't find much help on documentation but finally somehow figured out the stuffs. Beginners should look for other alternatives. But as it works find for me I am giving it 4 stars.


0
Zeyang XuBrooklyn, NY4 Ratings0 Reviews
3 months ago
truestarKR, Seoul7 Ratings0 Reviews
divide and conquer
10 months ago
Hard to Use

Alternatives

elmCompiler for Elm, a functional language for reliable webapps.
User Rating
4.8/ 5
4
Top Feedback
2Great Documentation
2Easy to Use
GitHub Stars
7K
Weekly Downloads
28K
lodashA modern JavaScript utility library delivering modularity, performance, & extras.
User Rating
4.6/ 5
515
Top Feedback
58Great Documentation
56Easy to Use
38Performant
GitHub Stars
51K
Weekly Downloads
40M
und
underscoreJavaScript's utility _ belt
User Rating
4.3/ 5
74
Top Feedback
16Great Documentation
13Easy to Use
7Performant
GitHub Stars
26K
Weekly Downloads
10M
liv
livescriptLiveScript is a language which compiles to JavaScript. It has a straightforward mapping to JavaScript and allows you to write expressive code devoid of repetitive boilerplate. While LiveScript adds many features to assist in functional style programming, it also has many improvements for object oriented and imperative programming.
User RatingN/A
Top Feedback
N/A
GitHub Stars
2K
Weekly Downloads
1K
rubico[a]synchronous functional programming
User Rating
5.0/ 5
2
Top Feedback
1Great Documentation
1Easy to Use
1Performant
GitHub Stars
177
Weekly Downloads
677
See 13 Alternatives

Tutorials

No tutorials found
Add a tutorial