Skip to content

Commit

Permalink
Update satisfy impl
Browse files Browse the repository at this point in the history
  • Loading branch information
albertprz committed Nov 7, 2023
1 parent 7fd3066 commit a55aefc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Bookhound/Parser.purs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,10 @@ except
satisfy :: forall a. (a -> Boolean) -> Parser a -> Parser a
satisfy cond ma = do
c2 <- ma
guard $ cond c2
pure c2
if cond c2 then
pure c2
else
empty

withError :: forall a. String -> Parser a -> Parser a
withError = withErrorN 0
Expand Down

0 comments on commit a55aefc

Please sign in to comment.