diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-10-27 21:07:47 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-10-27 21:07:47 -0700 |
commit | e77d08e439e727111b05a832531fdf86d03d2436 (patch) | |
tree | 4a6be1ec4f5be913a56aa5fa54d8d8bdaafe0279 | |
parent | 7a924ec55a8c9f9d4c887b3781ebeddbbf9d86e5 (diff) | |
download | pandoc-e77d08e439e727111b05a832531fdf86d03d2436.tar.gz |
hlint suggestions.
-rw-r--r-- | src/Text/Pandoc/BCP47.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/CSV.hs | 2 | ||||
-rw-r--r-- | src/Text/Pandoc/Class.hs | 9 | ||||
-rw-r--r-- | src/Text/Pandoc/Highlighting.hs | 2 |
4 files changed, 7 insertions, 8 deletions
diff --git a/src/Text/Pandoc/BCP47.hs b/src/Text/Pandoc/BCP47.hs index d49a0c115..0f1421555 100644 --- a/src/Text/Pandoc/BCP47.hs +++ b/src/Text/Pandoc/BCP47.hs @@ -120,6 +120,6 @@ parseBCP47 lang = P.char 'x' P.char '-' cs <- P.many1 $ P.satisfy (\c -> isAscii c && isAlphaNum c) - guard $ length cs >= 1 && length cs <= 8 + guard $ not (null cs) && length cs <= 8 let var = "x-" ++ cs return $ map toLower var diff --git a/src/Text/Pandoc/CSV.hs b/src/Text/Pandoc/CSV.hs index ee68d988b..924052dca 100644 --- a/src/Text/Pandoc/CSV.hs +++ b/src/Text/Pandoc/CSV.hs @@ -79,7 +79,7 @@ pCSVQuotedCell opts = do return $ T.pack res escaped :: CSVOptions -> Parser Char -escaped opts = do +escaped opts = case csvEscape opts of Nothing -> try $ char (csvQuote opts) >> char (csvQuote opts) Just c -> try $ char c >> noneOf "\r\n" diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs index c98a6411d..592ec11e5 100644 --- a/src/Text/Pandoc/Class.hs +++ b/src/Text/Pandoc/Class.hs @@ -121,10 +121,9 @@ import Data.ByteString.Base64 (decodeLenient) import Network.URI ( escapeURIString, nonStrictRelativeTo, unEscapeString, parseURIReference, isAllowedInURI, parseURI, URI(..) ) -import Network.HTTP.Client (httpLbs, responseBody, responseHeaders, - Request(port,host,requestHeaders)) -import Network.HTTP.Client (parseRequest) -import Network.HTTP.Client (newManager) +import Network.HTTP.Client + (httpLbs, responseBody, responseHeaders, + Request(port, host, requestHeaders), parseRequest, newManager) import Network.HTTP.Client.Internal (addProxy) import Network.HTTP.Client.TLS (tlsManagerSettings) import System.Environment (getEnv) @@ -432,7 +431,7 @@ getTranslations = do report $ CouldNotLoadTranslations (renderLang lang) $ case e of PandocCouldNotFindDataFileError _ -> - ("data file " ++ fallbackFile ++ " not found") + "data file " ++ fallbackFile ++ " not found" _ -> "" -- make sure we don't try again... modifyCommonState $ \st -> st{ stTranslations = Nothing } diff --git a/src/Text/Pandoc/Highlighting.hs b/src/Text/Pandoc/Highlighting.hs index 0754aae4c..cc72967e4 100644 --- a/src/Text/Pandoc/Highlighting.hs +++ b/src/Text/Pandoc/Highlighting.hs @@ -91,7 +91,7 @@ highlight syntaxmap formatter (_, classes, keyvals) rawCode = , traceOutput = False } classes' = map T.pack classes rawCode' = T.pack rawCode - in case msum (map ((`lookupSyntax` syntaxmap)) classes') of + in case msum (map (`lookupSyntax` syntaxmap) classes') of Nothing | numberLines fmtOpts -> Right $ formatter fmtOpts{ codeClasses = [], |