Pattern matching on hmatrix Vector type in haskell

87 Views Asked by At

That question sounds trivial but I really can't find anything helping me on how to deal with it. Here's a simple example to reproduce that on Haskell :

import Numeric.LinearAlgebra.HMatrix
madd :: Double -> Vector Double -> Vector Double
madd a v = a + v

when I load this it complains

Couldn't match expected type ‘Double’
              with actual type ‘Vector Double’

it thinks v is Double while it should be Vector Double, how can I force it in the pattern match to be so ?

please : I need to match the arguments, not just assign to a lambda function.

0

There are 0 best solutions below