Henning Thielemann wrote:

Data Orientation = Row | Column
Data Vector a = Vector Orientation [a]

In the first mail you wrote
"9. There are row vectors and column vectors, and these are different
types.  You get type errors if you mix them incorrectly."

I interpreted that you want to encode the information Row or Column into
the type. This sounds reasonable to me because multiplying e.g. a column
vector by a matrix is so obviously wrong that it should be detected
statically.
Sorry, I should have been more precise, I used too straightforward an encoding from Maple (which is dynamically typed) into Haskell. I should have used the usual type-trickery to encode the Orientation as 2 different types, to have ``types reflect values''.
Jacques
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to