/ HackerRank Functional Challenges

HR F#: Lambda Calculus - Reductions #3

The third λ-calculus problem is a bit more advanced (although still simple):

Reduce the following expression, using the beta-rule, to no more than one term. If the expression cannot be reduced, enter "CAN'T REDUCE".
((λx.(x x)) (λx.(x x)))

"beta-reduction" is just recution by substituting variable value in the function body with its value. Check Reductions #1 and Reductions #2 for more examples.

The expression ((λx.(x x)) (λx.(x x))) cannot be reduced. It is easy to see that applying reduction results with exactly the same expression. So the answer is "CAN'T REDUCE".

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.