Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

infestines

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

infestines

A minimalistic library to support writing FP libraries

  • 0.4.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.7K
decreased by-7.98%
Maintainers
1
Weekly downloads
 
Created
Source

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

Contents

Reference

Currying
I.arityN(n, (x1, ..., xm) => y) ~> x1 => ... => xn => y
I.curry((x1, ..., xn) => y) ~> x1 => ... => xn => y
I.curryN(n, (x1, ..., xn) => y) ~> x1 => ... => xn => y
I.curryN(2, x => {
  const x2 = x*x
  return y => x2 + y
})(2, 3)
// 7
Function composition
I.compose2U(b => c, (a1, ..., aN) => b) ~> a1 => ... aN => c
I.pipe2U((a1, ..., an) => b, b => c) ~> a1 => ... aN => c
Sequencing
I.seq(value, ...fns) ~> value
I.seqPartial(maybeValue, ...fns) ~> maybeValue
Basic combinators
I.always(x) ~> _ => x
I.applyU(x => y, x) ~> y
I.id(x) ~> x
I.sndU(_, x) ~> x
Constants
I.array0 ~> []

I.array0 is an empty frozen array [].

I.object0 ~> {}

I.object0 is an empty frozen object {}.

Type predicates
I.isArray(any) ~> boolean
I.isDefined(any) ~> boolean
I.isFunction(any) ~> boolean
I.isNumber(any) ~> boolean
I.isObject(any) ~> boolean
I.isString(any) ~> boolean
Equality
I.acyclicEqualsU(any, any) ~> boolean
I.hasKeysOfU(template, object)
I.identicalU(any, any) ~> boolean
I.whereEqU(template, object)
Objects
I.assocPartialU(key, value, object) ~> object
I.dissocPartialU(key, object) ~> object|undefined
I.hasU(propName, object) ~> boolean
I.keys(object) ~> [...keys]
I.unzipObjIntoU(object, keys, values)
I.values(object) ~> [...values]
OOP
I.constructorOf(any) ~> Function|null|undefined
I.inherit(Derived, Base, Methods, Statics) ~> Derived

Keywords

FAQs

Package last updated on 08 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc