3 ms·
I had no idea there was such thing as an improper suffix. Here's a quibble-free parser which returns a tail which is neither a "proper suffix nor a suffix".
by mrkeen 3y ago
I had no idea there was such thing as an improper suffix.
Here's a quibble-free parser which returns a tail which is neither a "proper suffix nor a suffix".
earlyTerminate c = Parser $ \s ->
case s of
[] -> Right (s, ())
(x:xs) | x == c -> Right ("", ())
| otherwise -> Left "Not a terminator"
> although considerable care would be needed with backtracking
No shit. Show your example.