第一个where部分中rs
定义有什么问题?
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,但它的语法规则使我感到困惑。错误信息是: [请注意,这是拼音,汉字上的语法存在歧义] wǒ zhèngzài xuéxí Haskell, dàn tā de yǔfǎ guīzé shǐ wǒ gǎndào kùnhuò. Cùowù xìnxī shì:
[1 of 1] Compiling Main ( pelindrome.hs, interpreted )
pelindrome.hs:5:8: parse error on input `rs