hoff
v1.3.1
Published
A collection of higher order functions you may find useful
Downloads
1
Maintainers
Readme
hoff - Higher Order Function File
Overview
Hoff is a collection of higher order functions. I don't really have a goal here other than to show that these high-level functions are really easy to write in ES6. And I thought the name hoff
would be cool for a library of HOFs so here it is.
Functions
compose
- wraps functionsf(x)
andg(x)
such thatg(f(x))
.sequence
- wraps functionsf(x)
andg(x)
such thatf(g(x))
.partial
- partially applies a functionf
with thearguments
given and returns a function that waits for the remaining arguments.curry
- will return functions until the number of arguments given matches or exceeds the number of arguments in functionf
, then returns the value of the function's execution.identity
- returns a function that returns a stored value. Nothing fancy.not
- returns a function that returns the negation of the function invocation.partition
- Splits an array in two based on apredicate
function:[elementsThatMatch, elementsThatDontMatch]
.
You should write more functions to do __________.
You're absolutely right! File an issue!