predicate logic
This commit is contained in:
parent
eb965050f3
commit
39d07b7c0b
5 changed files with 254 additions and 0 deletions
|
@ -88,3 +88,6 @@ parseIf description check = Parser $ \input@(Input pos xs) ->
|
|||
(char:chars)
|
||||
| check char -> Right $ (char,) $ Input (pos + 1) chars
|
||||
| otherwise -> Left $ expected description input
|
||||
|
||||
parseFail :: Show s => String -> Parser s a
|
||||
parseFail thing = Parser $ \input -> Left $ expected thing input
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue