From b717204d337c8833e5b8704d01466c836aeef091 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 24 Oct 2016 21:18:23 +0200 Subject: GHC 7.10 compatibility Bumps base version requirement to 4.8 due to https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysTheimportof...isredundant --- src/Codec/Pesto/Parse.lhs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Codec/Pesto/Parse.lhs') diff --git a/src/Codec/Pesto/Parse.lhs b/src/Codec/Pesto/Parse.lhs index 5e6d23c..e72fc21 100644 --- a/src/Codec/Pesto/Parse.lhs +++ b/src/Codec/Pesto/Parse.lhs @@ -22,7 +22,6 @@ Language syntax > , spaces1 > , notspace > ) where -> import Control.Applicative ((<*>), (<$>), (<*), (*>)) > import Data.Char (isSpace) > import Data.Ratio ((%)) > import Text.Parsec hiding (parse) @@ -73,6 +72,7 @@ The pesto grammar has two instruction types: The first one begins with a start symbol (``start``) and consumes any character up to and including a terminating symbol (``end``), which can be escaped with a backslash (``\``). +> betweenEscaped :: Char -> Char -> Parsec String () String > betweenEscaped start end = > char start > *> many (try (char '\\' *> char end) <|> satisfy (/= end)) @@ -92,6 +92,7 @@ Here are examples for both: The second one starts with one identifying character, ignores the following whitespace characters and then consumes an object or a quantity. +> oparg :: Char -> Parsec String () Instruction -> Parsec String () Instruction > oparg ident cont = char ident *> spaces *> cont > ingredient = oparg '+' (Ingredient <$> quantity) > tool = oparg '&' (Tool <$> quantity) -- cgit v1.2.3