【发布时间】:2019-01-22 13:21:27
【问题描述】:
“scalarNew 函数中的非穷举模式” 在这种情况下是什么意思?
scalarNew :: [Integer]->[Integer]->Integer
scalarNew (x:xs) (y:ys)
| (length xs == length ys) = x * y + scalarNew xs ys
| otherwise = error "error"
【问题讨论】:
-
尝试写一个没有递归的版本。提示:使用
zipWith和sum。
标签: haskell