1
我正在执行合并排序的合并子程序。编译时出现以下错误消息:输入|解析错误解析卫士的错误
merge :: [Int] -> [Int] -> [Int]
merge xs ys = go xs ys []
where go xs ys zs =
|null ys = zs ++ xs
|null xs = zs ++ ys
|(head xs) <= head ys = go (tail xs) ys (head xs : zs)
|otherwise = go xs (tail ys) (head ys : zs)
谁能告诉我为什么?还有更简洁的做法吗?谢谢。
您有一个额外的'=''后去XS YS zs' - 定义与警卫东西的时候,在'='来,只有每个后卫之后,你已经有了。 –