Udo Stenzel: >Bjorn Lisper wrote: >> - your definition of fromInteger will behave strangely with the elementwise >> extended operations, like (+). 1 + [[1,2],[3,4]] will become >> [[2,2],[3,5]] rather than [[2,3],[4,5]]. Array languages supporting this >> kind of overloading invariably have the second form of semantics. > >Don't call an array a matrix. If is named matrix, it should have >matrix multiplication, addition, and they should obey the expected laws.
But you still have the problem with the overloading of constants in your proposal. If you write 17 + a, where a is a matrix, what do people in general expect it to be? Björn Lisper _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
