我遇到以下haskell语句的问题:
insertSort3 xs =
let sort3 [] ys = ys
sort3 (x:xs) ys = sort3 xs (insert x ys)
in sort3 xs []
我的编译器说:输入'='时解析错误(错误发生在第三行)。
答案 0 :(得分:5)
问题是let
第二行中的缩进:
insertSort3 xs =
let sort3 [] ys = ys
-- the next line should line up with the previous sort3
sort3 (x:xs) ys = sort3 xs (insert x ys)
in sort3 xs []