Home

Awesome

<a id="infestines"></a> Infestines · GitHub stars npm

This is a minimalistic library of basic utilities, such as currying, for writing more interesting high performance FP libraries. This library is not intended to be used for application programming. Primitives that are too specialized to be used as a basis for nearly optimal implementations of higher level operations are not provided.

npm version Bower version Build Status Code Coverage

<a id="contents"></a> Contents

<a id="reference"></a> Reference

<a id="currying"></a> Currying

<a id="I-arityN"></a> I.arityN(n, (x1, ..., xm) => y) ~> x1 => ... => xn => y
<a id="I-curry"></a> I.curry((x1, ..., xn) => y) ~> x1 => ... => xn => y
<a id="I-curryN"></a> I.curryN(n, (x1, ..., xn) => y) ~> x1 => ... => xn => y
I.curryN(2, x => {
  const x2 = x*x
  return y => x2 + y
})(2, 3)
// 7

<a id="function-composition"></a> Function composition

<a id="I-compose2"></a> I.compose2(b => c, (a1, ..., aN) => b) ~> a1 => ... aN => c
<a id="I-pipe2"></a> I.pipe2((a1, ..., an) => b, b => c) ~> a1 => ... aN => c

<a id="sequencing"></a> Sequencing

<a id="I-seq"></a> I.seq(value, ...fns) ~> value
<a id="I-seqPartial"></a> I.seqPartial(maybeValue, ...fns) ~> maybeValue

<a id="basic-combinators"></a> Basic combinators

<a id="I-always"></a> I.always(x, _) ~> x
<a id="I-apply"></a> I.apply(x => y, x) ~> y
<a id="I-id"></a> I.id(x) ~> x
<a id="I-snd"></a> I.snd(_, x) ~> x

<a id="constants"></a> Constants

<a id="I-array0"></a> I.array0 ~> []

I.array0 is an empty frozen array [].

<a id="I-object0"></a> I.object0 ~> {}

I.object0 is an empty frozen object {}.

<a id="type-predicates"></a> Type predicates

<a id="I-isArray"></a> I.isArray(any) ~> boolean
<a id="I-isDefined"></a> I.isDefined(any) ~> boolean
<a id="I-isFunction"></a> I.isFunction(any) ~> boolean
<a id="I-isInstanceOf"></a> I.isInstanceOf(Type, any) ~> boolean
<a id="I-isNumber"></a> I.isNumber(any) ~> boolean
<a id="I-isObject"></a> I.isObject(any) ~> boolean
<a id="I-isString"></a> I.isString(any) ~> boolean
<a id="I-isThenable"></a> I.isThenable(any) ~> boolean

<a id="equality"></a> Equality

<a id="I-acyclicEquals"></a> I.acyclicEquals(any, any) ~> boolean
<a id="I-hasKeysOf"></a> I.hasKeysOf(template, object)
<a id="I-identical"></a> I.identical(any, any) ~> boolean
<a id="I-whereEq"></a> I.whereEq(template, object)

<a id="objects"></a> Objects

<a id="I-assocPartial"></a> I.assocPartial(key, value, object) ~> object
<a id="I-dissocPartial"></a> I.dissocPartial(key, object) ~> object|undefined
<a id="I-has"></a> I.has(propName, object) ~> boolean
<a id="I-keys"></a> I.keys(object) ~> [...keys]
<a id="I-toObject"></a> I.toObject(object) ~> object
<a id="I-unzipObjInto"></a> I.unzipObjInto(object, keys, values)
<a id="I-values"></a> I.values(object) ~> [...values]

<a id="oop"></a> OOP

<a id="I-inherit"></a> I.inherit(Derived, Base, Methods, Statics) ~> Derived

<a id="meta"></a> Meta

<a id="I-constructorOf"></a> I.constructorOf(any) ~> Function|null|undefined
<a id="I-create"></a> I.create(proto[, properties]) ~> object
<a id="I-freeze"></a> I.freeze(any) ~> any
<a id="I-defineName"></a> I.defineName(function, string) ~> function
<a id="I-prototypeOf"></a> I.prototypeOf(any) ~> object|null|undefined

<a id="imperative"></a> Imperative

<a id="I-assign"></a> I.assign(to, ...from) ~> to

<a id="promises"></a> Promises

<a id="I-resolve"></a> I.resolve(any) ~> promise

<a id="algebras"></a> Algebras

<a id="algebra-constructors"></a> Algebra constructors
<a id="I-Functor"></a> I.Functor(map) ~> functor
<a id="I-Applicative"></a> I.Applicative(map, of, ap) ~> applicative
<a id="I-Monad"></a> I.Monad(map, of, ap, chain) ~> monad
<a id="fantasy-land"></a> Fantasy land
<a id="I-FantasyFunctor"></a> I.FantasyFunctor ~> functor
<a id="I-fromFantasyApplicative"></a> I.fromFantasyApplictive(Type) ~> applicative
<a id="I-fromFantasyMonad"></a> I.fromFantasyMonad(Type) ~> monad
<a id="I-fromFantasy"></a> I.fromFantasy(Type) ~> functor|applicative|monad
<a id="base-algebras"></a> Base algebras
<a id="I-Async"></a> I.Async ~> monadish
<a id="I-Identity"></a> I.Identity ~> monad
<a id="I-IdentityAsync"></a> I.IdentityAsync ~> monadish
<a id="algebra-combinators"></a> Algebra combinators
<a id="I-IdentityOr"></a> I.IdentityOr(predicate, applicative|monad) ~> applicative|monad