Implementation of lambda functions based on book : "Understanding Computation"