Type Signatures in Haskell -
Type Signatures in Haskell - my question regarding type signatures. the next code complies: data vector = vector a deriving (show) vmult :: (num a) => vector -> -> vector (vector j k) `vmult` m = vector (i*m) (j*m) (k*m) however, not understand why substituting above type signature (on line number 2) next does not work: vmult :: (num a) => vector -> num -> vector my understanding since m of type num (eg. number 8 ), , since i, j, k num well, there should no problems computing vector (i*m) (j*m) (k*m) . kindly right understanding. num a isn't type @ all num type class, if num a means a number type, then vmult :: (num a) => vector -> -> vector means "as long a number type, vmult takes vector of a s , single a , returns vector of a s." that means vmult can work like vmult :: vector int -> int -> vector int or vmult :: vector double -> double -> vector double . notice each type rep