Subject: Re: 360 homework

> 
> Hi Christian
> 
> Hi have a few homework questions I can't quite get.
> 
> (4.29) write a function 'unique'.

unique xs = unique' xs xs 
unique (x:xs) ys = 
   | memberNum x ys == 1   = -- fill in the rest!
   | otherwise             = -- fill in the rest!


> (4-30) Can you pick up a negative in pattern matching?

I actually haven't done this one myself...

> (6-23) write an operator function

infix 1 $$ 

$$ :: Eq a => a -> [a] -> Bool 
  $$ [] = False
  $$ (y:xs) 
     | x == y     = True
     | otherwise  = x $$ xs


> (7-35) (4) write a function 'transpose'm m'

transpose'm :: Matrix -> Matrix 
transpose'm ((a1,a2,a3),(a4,a5,a6),(a7,a8,a9)) = 
  --- fill in the rest here! ---


> Do you have the answers for these?

/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
___________________________________________________________________________