Purify

Functional programming library for TypeScript

$ npm install purify-ts

Not just a port

For purify, bringing popular patterns doesn't mean copying the implementation down to the last details, it means expressing ideas in the cleanest way possible using the tools of the language

Algebraic Data Types

Purify provides a collection of algebraic data structures that will help you tackle common problems that increase code complexity, such as conditional logic and error handling

Practical approach

Purify is a library focused on practical functional programming in TypeScript. You will find many examples and tutorials in the docs section of this site.
Turn
const getUsers = (country?: Country): User[] => {
    if (!country) {
        return []
    }

    const users = getUsersByCountry(country)

    if (!users) {
        return []
    }

    return users
}
into
import { Maybe } from 'purify-ts/adts/Maybe'

const getUsers = (country?: Country): User[] =>
    Maybe.fromNullable(country)
         .chain(getUsersByCountry)
         .orDefault([])