13 - × is not associative[whereas multiplication × on...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
who :: Person -> Name height :: Person -> Float age :: Person -> Int eyeColour :: Person -> Colour dateOfBirth :: Person -> Date height (_, h, _, _, _) = h ... Just like products, records can be nested, so that in the above example we might have Date = RECORD day : [1. ..31]; month : [1. ..12]; year : [1900. ..1990] END Fact Let A i be fnite sets For each 1 i n . Then | A 1 × . . . × A n | = | A 1 | × . . . × | A n | . This Fact can be simply proved by the ‘induction principle’, introduced next term. Notice that we can now Form the product oF three sets in three diFFerent ways: A × B × C ( A × B ) × C A × ( B × C ) These sets are all diFFerent, so the set-operator
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: × is not associative [whereas multiplication × on numbers is associative]. There is however a clear corre-spondence between the elements ( a, b, c ) and (( a, b ) , c ) and ( a, ( b, c )) , and so these sets are in some sense equivalent. We make this intuition precise later in the course. This phenomenon also occurs with Haskell types. A natural example is type Name = String type Firstname = String type Secondname = String type Surname = String Name1 ::= (FirstName, SecondName, Surname) 14...
View Full Document

This note was uploaded on 01/02/2010 for the course MATH Math2009 taught by Professor Koskesh during the Spring '09 term at SUNY Empire State.

Ask a homework question - tutors are online