/ 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 likes functional programming, algorithms and code reviews. Apart from programming, his favourites are walking with his family in the parks and national trails and reading books.

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.