Why complains Haskell parse error on input `|' in this Function?

一世执手 提交于 2019-12-18 09:49:38

问题


I was supposed to write a little function in Haskell, which should erase elements, which are twice in the list. Unfortunately, Haskell complains " parse error on input `|' ". Could anyone help me with that?

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

回答1:


You are mixing tabs and spaces, which is no good when indentation is significant. Use either all spaces (strongly recommended), or all tabs.



来源:https://stackoverflow.com/questions/24918779/why-complains-haskell-parse-error-on-input-in-this-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!