From ffe0fcb40023d86af29a4805a34480f4c3726a77 Mon Sep 17 00:00:00 2001 From: alam0055 Date: Mon, 4 Nov 2024 09:59:27 +0800 Subject: [PATCH] fixed the `satisfy` parser to handle predicates --- _chapters/parsercombinators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_chapters/parsercombinators.md b/_chapters/parsercombinators.md index 9c258701..efb09b20 100644 --- a/_chapters/parsercombinators.md +++ b/_chapters/parsercombinators.md @@ -276,7 +276,7 @@ We can generalise the `is` parser to handle a predicate satisfy :: (Char -> Bool) -> Parser Char satisfy predicate = do c <- character - let next = if f c then pure else unexpectedCharParser + let next = if predicate c then pure else unexpectedCharParser next c