
21 Jun
2006
21 Jun
'06
4:57 p.m.
Jared Updike wrote:
Wouldn't you want the expression
[[1,0],[0,2]] + 10 to yield [[11,10],[10,12]]
You could handle this as a special case in (+) and (*), but this is kind of a hack. Something like:
(+) [[x]] y = map (map (x+)) y (+) x [[y]] = map (map (+y)) x (+) x y = zipWith (zipWith (+)) x y
Twan