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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to