logo

Crowdly

Browser

Add to Chrome

Using the combinator-based definitions for cons, head, and tail from the "Higher...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Using the combinator-based definitions for cons, head, and tail from the "Higher-Order Functions" chapter:

cons = x => y => f => f(x)(y)

head = l => l(K) where K = x => y => x

tail = l => l(K(I)) where I = x => x

What is the result of head(tail(cons(1)(cons(2)(null))))?

More questions like this

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome