假设我想在Haskell中添加两个列表.最常用的方法是什么?
这是我做的:
addLists :: (Integral a) => [a] -> [a] -> [a] addLists xs ys = map add $ zip xs ys where add (x, y) = x+y
haskell nested-lists
haskell ×1
nested-lists ×1