No idea what the problem is. Following exactly the hmatrix buildMatrix doc:
Prelude Data.Packed.Matrix> let k= buildMatrix 3 4 ( (r,c) -> fromIntegral r * fromIntegral c)
<interactive>:1:26:
Pattern syntax in expression context:
(r, c) -> fromIntegral r * fromIntegral c
In the docs, the markup wasn’t properly escaped, it must be
The haddock markup was
The backslashes need to be escaped for them to be displayed.