:3 im tired of typing these

This commit is contained in:
Rowan 2025-04-17 19:48:35 -05:00
parent a609120cb8
commit 0f2577167f

View file

@ -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) => {