Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (11 sloc) 294 Bytes
/*
const id = fn => fn(fn)
const Y = caller =>
id(fn => caller((...args) => fn(fn)(...args)))
*/
// Not really a Y combinator but can be used as such
// with close to no performance costs
module.exports = f => {
const fn = f(function () { return fn.apply(null, arguments) })
return fn
}