RosettaCodeData/Task/Variables/Haskell/variables-6.hs
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

10 lines
304 B
Haskell

dotProduct :: [Int] -> [Int] -> Int
dotProduct ns ms = sum $ zipWith (+) ns ms
-- Without the type signature, dotProduct would
-- have a more general type.
foobar :: Num a => a
foobar = 15
-- Without the type signature, the monomorphism
-- restriction would cause foobar to have a less
-- general type.