Jump to content

Vector products: Difference between revisions

m
→‎{{header|Haskell}}: removed some empty lines
(Added Haskell)
m (→‎{{header|Haskell}}: removed some empty lines)
Line 471:
 
=={{header|Haskell}}==
<lang haskell>type Vector a = [a]
type Vector a = [a]
type Scalar a = a
 
Line 503 ⟶ 502:
, "a . b x c = " ++ (show $ scalarTriple a b c)
, "a x b x c = " ++ (show $ vectorTriple a b c)
, "a . d = " ++ (show $ dot a d) ]</lang>
Output:<pre>
</lang>
Output:
<pre>
a . b = 49
a x b = [5,5,-7]
a . b x c = 6
a x b x c = [-267,204,-3]
a . d = *** Exception: Dotted Vectors must be of equal dimension.</pre>
</pre>
 
=={{header|Icon}} and {{header|Unicon}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.