:3 im tired of typing these
This commit is contained in:
parent
a609120cb8
commit
0f2577167f
1 changed files with 6 additions and 1 deletions
|
@ -11,11 +11,16 @@ import { concat as iconcat, isIterable, iter } from './list.js'
|
||||||
*/
|
*/
|
||||||
export const id = x => x
|
export const id = x => x
|
||||||
|
|
||||||
|
export const tap = curry((f, x) => {
|
||||||
|
f(x)
|
||||||
|
return x
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {...Fn} fns
|
* @param {...Fn} fns
|
||||||
* @returns {(x: any) => any}
|
* @returns {(x: any) => any}
|
||||||
*/
|
*/
|
||||||
export const pipe = (...fns) => x => fns.reduce((v, f) => f(v), x)
|
export const pipe = ([f, ...fns]) => (...args) => fns.reduce((v, f) => f(v), f(...args))
|
||||||
|
|
||||||
export const concat = dispatch(['fantasy-land/concat', 'concat'],
|
export const concat = dispatch(['fantasy-land/concat', 'concat'],
|
||||||
(b, a) => {
|
(b, a) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue