Not truly equivalent!
let's define `delete(file)`, which returns 0 if it successfully deletes the file, and 1 if there's an error.
ifFn(trueFn, delete('A'), delete('B')) will not do what you want it to.
let's define `delete(file)`, which returns 0 if it successfully deletes the file, and 1 if there's an error.
ifFn(trueFn, delete('A'), delete('B')) will not do what you want it to.
Depending on the language, the syntax of "if then else" is not needed and is syntactic sugar.
In the Lambda Calculus you can implement "if else" using "first" and "second".
Here is something equivalent in JavaScript.