Subject: Re: 360 Ass 2

> With regard to the first part of the Assignment:
> 
>  I am writing the function stockValue, which has an input of a list of
> Items.  Am I right in thinking that each 'Item' is a tuple?  How can I
> access a specific field of a tuple, such as the 'Amount' field?
> 

Use a pattern-matching function:

   stockValue ((item,amout,count):xs) = ....

/CC



___________________________________________________________________________
Christian Collberg      | Email: c_collberg@cs.auckland.ac.nz
Computer Science Dept   | Fax:   +64-9-373-7453
University of Auckland  | Phone: +64-9-373-7599 x 6137
Private Bag 92019,      | WWW:   http://www.cs.auckland.ac.nz/~collberg/
Auckland, NZ            |
___________________________________________________________________________
"Education is an admirable thing, but it is well to remember from time
to time that nothing that is worth knowing can be taught." - Oscar Wilde
___________________________________________________________________________