All Projects → nullobject → Fkit

nullobject / Fkit

Licence: mit
A functional programming toolkit for JavaScript.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Fkit

Yalinqo
Yet Another LINQ to Objects for PHP [Simplified BSD]
Stars: ✭ 400 (-31.97%)
Mutual labels:  library, functional-programming, functional
Kotlin Result
A multiplatform Result monad for modelling success or failure operations.
Stars: ✭ 369 (-37.24%)
Mutual labels:  functional-programming, functional, fp
Sup
Composable, purely functional healthchecks in Scala.
Stars: ✭ 138 (-76.53%)
Mutual labels:  functional-programming, functional, fp
Fasy
FP iterators that are both eager and asynchronous
Stars: ✭ 488 (-17.01%)
Mutual labels:  library, functional-programming, fp
Eslint Plugin Functional
ESLint rules to disable mutation and promote fp in JavaScript and TypeScript.
Stars: ✭ 282 (-52.04%)
Mutual labels:  functional-programming, functional, fp
Observable
The easiest way to observe values in Swift.
Stars: ✭ 346 (-41.16%)
Mutual labels:  library, functional
Fun Task
Abstraction for managing asynchronous code in JS
Stars: ✭ 363 (-38.27%)
Mutual labels:  functional-programming, fp
Meza
A Python toolkit for processing tabular data
Stars: ✭ 374 (-36.39%)
Mutual labels:  library, functional-programming
Carp
Carp is a programming language designed to work well for interactive and performance sensitive use cases like games, sound synthesis and visualizations.
Stars: ✭ 4,389 (+646.43%)
Mutual labels:  functional-programming, functional
Shapeless
Generic programming for Scala
Stars: ✭ 3,207 (+445.41%)
Mutual labels:  functional-programming, fp
Lager
C++ library for value-oriented design using the unidirectional data-flow architecture — Redux for C++
Stars: ✭ 379 (-35.54%)
Mutual labels:  library, functional-programming
Fpo
FP library for JavaScript. Supports named-argument style methods.
Stars: ✭ 419 (-28.74%)
Mutual labels:  library, functional-programming
Morphism
⚡ Type-safe data transformer for JavaScript, TypeScript & Node.js.
Stars: ✭ 336 (-42.86%)
Mutual labels:  functional, fp
Monio
Async-capable IO monad for JS
Stars: ✭ 311 (-47.11%)
Mutual labels:  functional-programming, fp
Prelude Ts
Functional programming, immutable collections and FP constructs for typescript and javascript
Stars: ✭ 315 (-46.43%)
Mutual labels:  functional-programming, fp
Fp Jargon Zh
函数式编程术语及示例。本项目译自 https://github.com/hemanth/functional-programming-jargon
Stars: ✭ 507 (-13.78%)
Mutual labels:  functional-programming, fp
Functional Programming Learning Path
A Learning Path for Functional Programming
Stars: ✭ 582 (-1.02%)
Mutual labels:  functional-programming, functional
Moses
Utility library for functional programming in Lua
Stars: ✭ 541 (-7.99%)
Mutual labels:  functional-programming, functional
Coconut
Simple, elegant, Pythonic functional programming.
Stars: ✭ 3,422 (+481.97%)
Mutual labels:  functional-programming, functional
Hof
Higher-order functions for c++
Stars: ✭ 467 (-20.58%)
Mutual labels:  functional-programming, functional

FKit

Build Status

FKit (pronounced eff-kit) is a functional programming toolkit for JavaScript. It provides many functions for solving common problems with functions, objects, arrays, and strings. It aims to provide reusable building blocks while maintaining a laser focus on everyday utility.

Features:

  • Why reinvent the wheel? FKit provides many functions for solving everyday problems to do with functions, arrays, objects, and strings.

  • FKit treats both strings and arrays as lists, which means you can apply the same list functions to both strings and arrays (e.g. head, tail, map, filter, fold, etc).

  • Most FKit functions are already curried by default, so you can partially apply them wherever you need to.

  • The ordering of arguments to FKit functions is carefully designed to be more natural, this makes them highly composable.

  • It's very compact, roughly 3 KB when minified and gzipped!

Table of Contents

Getting Started

Node

Install the npm package:

> npm install fkit

Import just the functions you need:

import { add } from 'fkit'
console.log(add(1, 2))

Or import the whole library:

import * as F from 'fkit'
console.log(F.add(1, 2))

Browser

The easiest way to start using FKit in your browser is to include it with a <script> tag in your HTML file:

<script src="https://unpkg.com/fkit/dist/fkit.min.js"></script>

Documentation

Examples

Sum the numbers in a list:

import { sum } from 'fkit'
sum([1, 2, 3]) // 6

Stash a string:

import { map, surround } from 'fkit'
map(surround('{', '}'), 'hello') // '{h}{e}{l}{l}{o}'

Intersperse the numbers in a list with another number:

import { intersperse } from 'fkit'
intersperse(4, [1, 2, 3]) // [1, 4, 2, 4, 3]

Filter the numbers in a list where 1 <= n <= 5:

import { between } from 'fkit'
[1, 2, 3, 4, 5].filter(between(2, 4)) // [2, 3, 4]

Calculate the Cartesian product of two lists:

import { cartesian } from 'fkit'
cartesian([1, 2], [3, 4]) // [[1, 3], [1, 4], [2, 3], [2, 4]]

Calculate the permutations of a list:

import { permutations } from 'fkit'
permutations('abc') // ['abc', 'bac', 'cba', 'bca', 'cab', 'acb']

Check out some more examples:

Licence

FKit is licensed under the MIT licence. See the LICENCE file for more details.

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