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

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

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 finite 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
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

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern