为什么在输入"|"时抱怨Haskell解析错误 在这个功能?

SR2*_*R23 -1 haskell parse-error

我应该在Haskell中编写一个小函数,它应该擦除列表中两次的元素.不幸的是,Haskell抱怨"输入错误'|'' ".有人可以帮我吗?

makeSets=mSet[]s
         where 
            mSet stack []=stack
            mSet stack (x:xs)
                             |contains stack x=mSetstack xs
                             | otherwise =mSet (x:stack) xs
                                          where 
                                                contains [] thing=False
                                                contains (x:xs)thing
                                                                     | x==thing=True
                                                                     |otherwise=contains xs thing
Run Code Online (Sandbox Code Playgroud)

ama*_*loy 5

您正在混合制表符和空格,这在缩进很重要时并不好.使用所有空格(强烈推荐)或所有选项卡.