Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 614 Bytes

README.md

File metadata and controls

47 lines (35 loc) · 614 Bytes

FP util lib

Install

$ npm i github:hugomcm/util

Usage

Import

const { R, F, S, $, T, M, H } = require('@hugomcm/util')

// R (Ramda);
// F (Fluture);
// S (Sanctuary);
// $ (Sanctuary Types);
// T (Time)*;
// M (Math)*;
// H (My own generic pointfree functions)*

// *May have some non pure functions

Examples

pr('Hello World!')
// Hello World!

const arr = ['a', 'b', 'c', 'd']
const i = S.pipe([
  //
  H.findIndex(v => v === 'c'),
  H.tap(),
])(arr)
// TAP#1: 2

pr(i)
// 2

const decimalPlaces = 2
pr(M.roundA(decimalPlaces)(1.2342))
// 1.23