16 lines
493 B
Text
16 lines
493 B
Text
# Disable warning for shadowing of predefined function
|
|
lang.errorOutput = -1
|
|
|
|
fp.combY = (fp.f) -> {
|
|
# fp.f must be provided by the function with a partially called combinator function, because fp.f will not be available in the callee scope
|
|
fp.func = (fp.f, fp.x) -> {
|
|
fp.callFunc = (fp.f, fp.x, &args...) -> return fp.f(fp.x(fp.x))(&args...)
|
|
|
|
return fn.combAN(fp.callFunc, fp.f, fp.x)
|
|
}
|
|
|
|
return fn.combM(fn.combA2(fp.func, fp.f))
|
|
}
|
|
|
|
# Re-enable warning output
|
|
lang.errorOutput = 1
|