
21 Nov
2009
21 Nov
'09
12:39 p.m.
Hi Stephan,
instance Num a => Num [a] where (+) = zipWith (+) (-) = zipWith (-) (*) = zipWith (*) fromInteger = repeat . fromInteger abs = map abs signum = map signum
Oooh I had no idea you could do that with 'instance' I merge my lists into a list of pairs before I do anything with them so unevenness isn't a problem; I was just trying t convince haskell that I could use nice operators like '+' on my derived type. Thank you very much for your reply; between that and Felipe's I have enough to keep me busy all evening digesting the new toys you have demonstrated :) - Philip