
10 Jun
2016
10 Jun
'16
1:16 p.m.
On Fri, Jun 10, 2016 at 07:56:04PM +0300, Юрий Сыровецкий (Yuriy Syrovetskiy) wrote:
I think, this Parser type is not perfectly monoidal, so in general asum and (<|>) are not interchangeable.
Please can you post an example showing that? I am unable to replicate this behaviour. ghci> import Text.ParserCombinators.Parsec ghci> import Data.Foldable ghci> let ar = asum [space, space, fail "My fail"] :: Parser Char ghci> runParser ar () "" "x" Left (line 1, column 1): unexpected "x" expecting space My fail It seems that the custom fail is indeed picked up. No hint of "error" here. Tom