我试图编写一个用于对整数列表进行排序的代码,但是我从终端收到一条错误消息,代码和错误如下所示:
-- sort
type Element = Int
merge_sort :: [Element] -> [Element]
merge_sort list = case list of
[] -> []
[x] -> [x]
_ -> merge (merge_sort(list_left)) (merge_sort(list_right))
where (list_left, list_right) = split list
我收到以下错误:
[1 of 1] Compiling Main ( recursion test.hs, interpreted )
recursion test.hs:7:9: Not in scope: `merge'
recursion test.hs:8:42: Not in scope: `split'
Failed, modules loaded: none.
Prelude>
谁喜欢告诉我我的代码有什么问题?谢谢