Let a pure λ-function be a term containing nothing but abstractions and applications. In JavaScript, you can output the source code of a pure function by applying all the abstractions to variational functions that collect a list of arguments. That is, it is possible:
lambdaSource(function(x){return x(x)}) == "λx.(xx)"
See lambdaSource code for this value. This function has become especially useful for my interests, because it allows me to use existing JS engines to normalize unexplored expressions of lambda calculus much faster than any naive evaluator that I could write myself. Moreover, I know that the functions of λ-calculus can be expressed in Haskell using unsafeCoerce :
(let (
I do not know how to implement lambdaSource in Haskell due to the lack of variable functions. Is it possible to derive a normalized source of a pure λ-function on Haskell, so that:
lambdaSource (\ fx -> f
?
algorithm functional-programming haskell lambda-calculus
Maiavictor
source share