From f8a928d18371e0b67741f5d75b8154d1c105327b Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Sat, 18 Feb 2023 16:22:54 +1300 Subject: Introduce procs --- DSL/BaseParsers.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'DSL/BaseParsers.hs') diff --git a/DSL/BaseParsers.hs b/DSL/BaseParsers.hs index b4b5234..4da9c38 100644 --- a/DSL/BaseParsers.hs +++ b/DSL/BaseParsers.hs @@ -81,6 +81,9 @@ chain p q = do phrase :: Parser t a -> Parser t a phrase = (<* eof) +plus :: Parser t a -> Parser t b -> Parser t (a, b) +plus = liftA2 (,) + recover :: a -> Parser t a -> Parser t a recover x p = p <|> pure x -- cgit v1.2.1