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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

- 143 -and so on.def istype (t::o)= equal t (type o)def isbool obj = istype (bool_type::obj)def isnumb obj = istype (numb_type::obj)Here, we have explicitly provided a value for the second bound variable o from the new single bound variable obj.In practical terms, curried functions are more flexible <strong>to</strong> use but less efficient <strong>to</strong> implement as more function entry andexit is necessitated.7.17. SummaryIn this chapter we have:• represented composite values as lists• developed selec<strong>to</strong>r functions <strong>to</strong> simplify composite value manipulation• introduced generalised list structure matching• introduced notations for local definitions• considered the efficiency of naive linear list algorithms• represented trees as lists• developed functions <strong>to</strong> manipulate ordered binary trees• considered the efficiency of binary trees• met curried and uncurried functions, and partial applicationSome of these <strong>to</strong>pics arte summarised below.Generalised structure matchingdef [,, ... ] =def =Local definitionslet = in ==where = ==λ.

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

Saved successfully!

Ooh no, something went wrong!