rs
第一个 where 部分的定义有什么问题?
palindrome :: [a] -> [a]
palindrome xs = con xs rs
where con a b = rev (rev a []) b
rs = rev xs -- here
where rev [] rs = rs
rev (x:xs) rs = rev xs (x:rs)
我只是在学习 Haskell,但它的语法规则让我感到困惑。错误信息是
[1 of 1] Compiling Main ( pelindrome.hs, interpreted )
pelindrome.hs:5:8: parse error on input `rs'