/ HackerRank Functional Challenges

HR F#: Lambda Calculus - Evaluating Expressions #3

Although the Lambda Calculus - Evaluating Expressions #3 is probably the most simple of all the functional problems on Hackerrank (it is quite easy to solve it and even more easy to guess the right answer), it references the precious gem of the functional world: Church encoding.

Under Church encoding, what natural number does the expression \(λx.λy.x^{47}y\) represent?

Of course, the answer is 47. But the Church encoding is very nice, indeed.

Alex Netkachov

Alex Netkachov

Alex works at Central London on the next generation of energy trading solutions to traders, brokers and exchanges worldwide.

Read More

Why not to stay updated if the subject is interesting? Join Telegram channel Alex@Net or follow alex_at_net on Twitter. Or just, use the comments form below.