0.7.0 • Published 3 years ago

fp-kudojs v0.7.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

npm (scoped)


KudoJS is a small utility library with a collection of popular Algebraic Data Types and Helper functions to help you write code in a functional programming style in Javascript.

Installation

Install and save KudoJS as a dependency in your current project

$ npm install --save fp-kudojs

Import using CommonJS

const kudoJS = require("fp-kudojs") 

Import using JS Modules

import kudoJS from "fp-kudojs"

IIFE

<script src="/path/to/kudo.iife.js"></script>

Import single entities using CommonJS

const compose = require("fp-kudojs/function/compose");
const Maybe = require("fp-kudojs/adt/Maybe");

Import single entities using JS Modules

import compose from "fp-kudojs/function/compose";
import Maybe from "fp-kudojs/adt/Maybe";

Helper Functions

These are the functions under the kudoJS.* namespace


Algebraic Data Types (ADTs)

ADTs under the kudoJS.* namespace. All of the data types are compatible with the Fantasy Land Specifications

ADTConstructorsStatic MethodsInstance Methods
kudoJS.IdentityIdentity, ofequals, concat,ap, getValue, map,chain, toString
kudoJS.PairPair, ofequals, concat, fst, snd, ap, getValue, map, bimap, chain, swap, toString
kudoJS.Maybeof, Just, Nothing, zero, fromNullable, withDefaultcatMaybes, isNothing, isJustequals, ap, alt, map, chain, toString, getValue, isNothing, isJust
kudoJS.Eitherof, Left, Right, fromNullable, withDefaulttry, isLeft, isRightequals, ap, getValue, map, bimap, chain, swap, toString, isLeft, isRight
kudoJS.TaskTask, of, rejectedfork, concat, ap, getValue, map, chain, toPromise, toString
kudoJS.ReaderReader, of, askrunWith, ap, getValue, map, chain, toString
kudoJS.StateState, of, get, putrunWith, execWith, evalWith, ap, getValue, map, chain, toString

License

All code and documentation are (c) 2021 Ritesh Pillai and released under the MIT License. A copy of the MIT License is also included.

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.3

3 years ago

0.4.1

3 years ago

0.4.2

3 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.2.0

5 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.1.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago