13.07.2015 Views

Basic types, Lists, Trees, Higher-order functions

Basic types, Lists, Trees, Higher-order functions

Basic types, Lists, Trees, Higher-order functions

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

List constructors: [], nil and ::<strong>Lists</strong> are generated as follows:• the empty list is a list, designated [] or nil• if x is an element and xs is a list,then so is x :: xs(type consistency):: associate to the right, i.e. x 1 ::x 2 ::xs means x 1 ::(x 2 ::xs)::❅ ❅❅x 1 ::x 2❅ ❅❅xsGraph for x 1 ::x 2 ::xsc○Michael R. Hansen, Spring 2005 – p.17/59

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

Saved successfully!

Ooh no, something went wrong!