predicate logic

This commit is contained in:
hi 2025-08-29 12:53:28 +00:00
parent eb965050f3
commit 39d07b7c0b
5 changed files with 254 additions and 0 deletions

View file

@ -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