I'm relatively new to functional programming and while learning about it, I bumped into lambda calculus. The thing is that I found some questions but I don't really have the notions to answer them, and I was unable to find them so I am asking for help. I have the following lambda expression:

( \x.x ( \x.x \x.x ))

And I am asked to do a lazy evaluation on it. Of course, I do not really know what lazy evaluation is. My idea for evaluating this would be:

  1. ( \x.x ( \x.x ))
  2. ( \x.x ) ?

Which I am sure would be wrong since no result is given. Can anyone please point me in the right direction? I just to be sure when asked to do a normal evaluation or a lazy evaluation, what I must do.

Thank you for your time!

  • $\begingroup$ So a Google search for "lambda calculus lazy evaluation" gives en.wikipedia.org/wiki/Lazy_evaluation in the first two hits. The information about working with infinite data structures is immediately relevant to your particular lambda expression. If you are still seeking help, please clarify. (Also, why did a minus sign appear in your evaluation of the expression?) $\endgroup$ – Eric Towers Sep 8 '17 at 13:38
  • $\begingroup$ Thank you for your answer! First of all, sorry, I was just trying to show the steps of my evaluation. Now I have edited the question and it should ok. I would still need help to understand how to evaluate a lambda expression. I still don't know if my evaluation is correct. $\endgroup$ – Vaduva Mihaita Bogdan Sep 8 '17 at 13:44
  • $\begingroup$ FYI, maybe this question may also be suited for the Computer Science SE. $\endgroup$ – Karlo Sep 8 '17 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.