Parsing 解析haskell字符串时如何跳过空格

Parsing 解析haskell字符串时如何跳过空格,parsing,haskell,monads,spaces,Parsing,Haskell,Monads,Spaces,我在使用HaskellReadP库的解析器中有以下定义: expr = chainl1 comp (string "===" >> return fun6) 如何跳过==运算符前面的空格?我不知道如何在这个语法中包含它。ReadP正是针对这个用例的;然后,您的解析器变为 expr = chainl1 comp (skipSpaces >> string "===" >> return fun6) 我认为这个问题太宽泛了,因为听起来答案需要解释基本语法、

我在使用Haskell
ReadP
库的解析器中有以下定义:

expr = chainl1 comp (string "===" >> return fun6) 
如何跳过
==
运算符前面的空格?我不知道如何在这个语法中包含它。

ReadP
正是针对这个用例的;然后,您的解析器变为

expr = chainl1 comp (skipSpaces >> string "===" >> return fun6) 

我认为这个问题太宽泛了,因为听起来答案需要解释基本语法、单子和单子解析。有很多关于parser combinator库的教程,你可以看看。我知道如何解析,我只是在这篇文章的语法方面遇到了一些问题。一切正常,但当我尝试在运算符之前用空格解析字符串时,它们失败了……您是否尝试过
spaces>>string“==”>>returnfun6