All Projects β†’ mobily β†’ ts-belt

mobily / ts-belt

Licence: MIT license
πŸ”§ Fast, modern, and practical utility library for FP in TypeScript.

Programming Languages

typescript
32286 projects
ReScript
86 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ts-belt

tiinvo
Functions for tacit programming and functional types for TypeScript and JavaScript.
Stars: ✭ 36 (-91.8%)
Mutual labels:  monad, option, result
Kotlin Result
A multiplatform Result monad for modelling success or failure operations.
Stars: ✭ 369 (-15.95%)
Mutual labels:  fp, monad
apropos
Fast strong typed 'Either' data structure for typescript and flow
Stars: ✭ 20 (-95.44%)
Mutual labels:  fp, monad
Design-Patterns
Project for learning and discuss about design patterns
Stars: ✭ 16 (-96.36%)
Mutual labels:  fp, monad
fpEs
Functional Programming for EcmaScript(Javascript)
Stars: ✭ 40 (-90.89%)
Mutual labels:  fp, monad
Monio
Async-capable IO monad for JS
Stars: ✭ 311 (-29.16%)
Mutual labels:  fp, monad
Morphism
⚑ Type-safe data transformer for JavaScript, TypeScript & Node.js.
Stars: ✭ 336 (-23.46%)
Mutual labels:  array, fp
result
A lightweight C++11-compatible error-handling mechanism
Stars: ✭ 121 (-72.44%)
Mutual labels:  result, result-type
fnts
Ξ» Minimal Functional Programming Utilities for TypeScript & JavaScript
Stars: ✭ 75 (-82.92%)
Mutual labels:  fp, monad
function-composition-cheatsheet
Composition of Functions
Stars: ✭ 24 (-94.53%)
Mutual labels:  fp, monad
hkts
Functional programming tools: option, either, task, state, optics, etc.
Stars: ✭ 20 (-95.44%)
Mutual labels:  fp, monad
monas
πŸ¦‹ Scala monads for javascript
Stars: ✭ 21 (-95.22%)
Mutual labels:  monad, option
php-slang
The place where PHP meets Functional Programming
Stars: ✭ 107 (-75.63%)
Mutual labels:  fp, monad
Fun Task
Abstraction for managing asynchronous code in JS
Stars: ✭ 363 (-17.31%)
Mutual labels:  fp, monad
rust-error-handle
detail rust error handle
Stars: ✭ 47 (-89.29%)
Mutual labels:  option, result
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
Stars: ✭ 538 (+22.55%)
Mutual labels:  fp, monad
common
A minimal library that defines primitive building blocks of PHP code.
Stars: ✭ 28 (-93.62%)
Mutual labels:  option, result
either option
A small typed and safe library for error handling with functionnal programming concept in Dart and flutter project
Stars: ✭ 34 (-92.26%)
Mutual labels:  option, result
result17
A rust like Result type for modern C++
Stars: ✭ 13 (-97.04%)
Mutual labels:  monad, result-type
arrayfire-haskell
Haskell bindings to ArrayFire
Stars: ✭ 52 (-88.15%)
Mutual labels:  array

Build Status Coverage npm PRs Welcome All Contributors GitHub license

Fast, modern, and practical utility library for FP in TypeScript.

Documentation

Full documentation can be found here.

Features

  • πŸš€ built with ReScript, which generates highly performant JavaScript code (see the benchmark results here)
  • πŸ‘€ provides more readable code, due to the data-first approach
  • ✨ supports TypeScript and Flow
  • πŸ›‘ helps you write safer code with Option and Result types
  • 🎯 all functions return immutable data (no side-effects)
  • 🌲 tree-shakeable
  • πŸ“ fully documented

Getting started

Installation

yarn add @mobily/ts-belt

or with npm

npm install @mobily/ts-belt --save

Usage

Module Namespace Description
Array A Utility functions for Array.
Boolean B Utility functions for Boolean.
Number N Utility functions for Number.
Object (Dict) D Utility functions for Object.
String S Utility functions for String.
Guards G Various TypeScript guards.
Option O Functions for handling the Option data type that represents the existence and nonexistence of a value.
Result R Functions for describing the result of a certain operation without relying on exceptions.
Function F Other useful functions.
import { A, O, N, pipe } from '@mobily/ts-belt'

pipe(
  [1, 2, 3, 4, 5], // β†’ [1, 2, 3, 4, 5]
  A.dropExactly(2), // β†’ Some([3, 4, 5])
  O.flatMap(A.head), // β†’ Some(3)
  O.map(N.multiply(10)), // β†’ Some(30)
  O.getWithDefault(0), // β†’ 30
) // β†’ 30

Contributors


Marcin Dziewulski

πŸ’» πŸ“– ⚠️ 🎨 🚧

Krzysztof Lenda

πŸ“–

Radek KozieΕ‚

πŸ“–

Artur

πŸ“–

Dominik ŁopaciΕ„ski

πŸ’» πŸ“– ⚠️

Jakub WΔ…sik

πŸ“–

Krystian Mateusiak

πŸ’» πŸ“– ⚠️

MichaΕ‚ Miszczyszyn

πŸ€”

Kevin

πŸ“–

Anthony Khong

πŸ’» πŸ“– ⚠️

Pyrolistical

πŸ“– 🚧 πŸ€”

Mathieu Acthernoene

πŸ€”

License

The MIT License.

See LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].