Haskell's bed-and-breakfast library is the first library in the Linear algebra section in https://wiki.haskell.org/Applications_and_libraries/Mathematics. So, I'm trying:
let a = Matrix.fromList [[1,2,3], [4,5,6], [7,8,9]]
let b = Matrix.fromList [[1], [2], [3]]
a * b
*** Exception: Matrix.times: `numRows a' and `numCols b' don't match.
Wat? If I multiply [m x n] matrix by [n x p] matrix I should get [m x p] matrix, not this silly exception. Ok, maybe library author doesn't know where is left and where is right.
b * a
*** Exception: Ix{Int}.index: Index (2) out of range ((1,1))
Waaaaat?
... | numCols a /= numRows b = error "Matrix.times: `numRows a' and `numCols b' don't match."
which is eyebrow-raising ...a
and which isb
without reading the source oftimes
?) -- but the actual check is right. And in the old release, the text of the error matched the (wrong) check -- so it was semantically wrong but at least it was accurate to what the code actually did!