aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Parsing.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-09-28 11:56:51 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-09-28 11:56:51 -0700
commitc86691fb84ec830086bc9b5e54b1ec8e41d160c8 (patch)
treebff78fc2259df9ddad1edde9d57b0f17a3877e68 /src/Text/Pandoc/Parsing.hs
parent981b5de790d7625b717083cb1bcf6a88224f34dd (diff)
downloadpandoc-c86691fb84ec830086bc9b5e54b1ec8e41d160c8.tar.gz
Use Prelude.fail to avoid ambiguity with fail from GHC.Base.
Diffstat (limited to 'src/Text/Pandoc/Parsing.hs')
-rw-r--r--src/Text/Pandoc/Parsing.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index 49414a9a5..cffe846a5 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -343,16 +343,16 @@ notFollowedBy' p = try $ join $ do a <- try p
-- (This version due to Andrew Pimlott on the Haskell mailing list.)
oneOfStrings' :: Stream s m Char => (Char -> Char -> Bool) -> [String] -> ParserT s st m String
-oneOfStrings' _ [] = fail "no strings"
+oneOfStrings' _ [] = Prelude.fail "no strings"
oneOfStrings' matches strs = try $ do
c <- anyChar
let strs' = [xs | (x:xs) <- strs, x `matches` c]
case strs' of
- [] -> fail "not found"
+ [] -> Prelude.fail "not found"
_ -> (c:) <$> oneOfStrings' matches strs'
<|> if "" `elem` strs'
then return [c]
- else fail "not found"
+ else Prelude.fail "not found"
-- | Parses one of a list of strings. If the list contains
-- two strings one of which is a prefix of the other, the longer
@@ -525,7 +525,7 @@ romanNumeral upperCase = do
hundreds + nineties + fifties + forties + tens + nines +
fives + fours + ones
if total == 0
- then fail "not a roman numeral"
+ then Prelude.fail "not a roman numeral"
else return total
-- Parsers for email addresses and URIs
@@ -698,7 +698,7 @@ characterReference = try $ do
_ -> ent ++ ";"
case lookupEntity ent' of
Just (c : _) -> return c
- _ -> fail "entity not found"
+ _ -> Prelude.fail "entity not found"
-- | Parses an uppercase roman numeral and returns (UpperRoman, number).
upperRoman :: Stream s m Char => ParserT s st m (ListNumberStyle, Int)
@@ -1312,7 +1312,7 @@ failIfInQuoteContext :: (HasQuoteContext st m, Stream s m t)
-> ParserT s st m ()
failIfInQuoteContext context = do
context' <- getQuoteContext
- when (context' == context) $ fail "already inside quotes"
+ when (context' == context) $ Prelude.fail "already inside quotes"
charOrRef :: Stream s m Char => String -> ParserT s st m Char
charOrRef cs =