/ 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 Netkachov is a Senior Software Developer, currently working in Central London on new generation of energy trading solutions for brokers, traders and exchanges.

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.