10.07.2015 Views

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

An Introduction to Functional Programming Through Lambda Calculus

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

- 28 -The first argument identity was lost because the bound variable first does not appear in the bodyλsecond.second.In general, applying select_second <strong>to</strong> arbitrary arguments:and:returns the second arguemt:((select_second ) ) ==((λfirst.λsecond.second ) ) =>(σecond.second ) =>We can show that select_second applied <strong>to</strong> anything returns a version of identity. As before, we will use:<strong>to</strong> stand for an arbitrary expression, so:(select_second ) ==(λfirst.λsecond.second ) =>λsecond.secondIf second is replaced by x then:becomes:λsecond.secondλx.xNotice that select_first applied <strong>to</strong> identity returns a version of select_second:(select_first identity) ==(λfirst.λsecond.first identity) =>λsecond.identity ==λsecond.λx.xIf second is replaced by first and x by second then this becomes:λfirst.λsecond.second

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!