From fdce771a4e56c5763c449cf41fbee33b69a11541 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 28 Oct 2018 10:46:45 -0700 Subject: Hlint changes. --- src/Text/Pandoc/Readers/Man.hs | 11 +++++------ src/Text/Pandoc/Readers/Roff.hs | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs index f2fd4b0e1..89ac7ee51 100644 --- a/src/Text/Pandoc/Readers/Man.hs +++ b/src/Text/Pandoc/Readers/Man.hs @@ -1,5 +1,5 @@ {-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} + {- Copyright (C) 2018 Yan Pashkovsky and John MacFarlane @@ -224,7 +224,7 @@ mmacro mk = msatisfy isMMacro where mmacroAny :: PandocMonad m => ManParser m RoffToken mmacroAny = msatisfy isMMacro where - isMMacro (MMacro{}) = True + isMMacro MMacro{} = True isMMacro _ = False -- @@ -387,8 +387,8 @@ parseCodeBlock = try $ do | not (null ss) , all isFontToken ss = Nothing | otherwise = Just $ linePartsToString ss - where isFontToken (FontSize{}) = True - isFontToken (Font{}) = True + where isFontToken FontSize{} = True + isFontToken Font{} = True isFontToken _ = False extractText MEmptyLine = Just "" -- string are intercalated with '\n', this prevents double '\n' @@ -456,8 +456,7 @@ definitionListItem = try $ do term <- parseInline moreterms <- many $ try $ do mmacro "TQ" - newterm <- parseInline - return newterm + parseInline inls <- option mempty parseInlines continuations <- mconcat <$> many continuation return ( mconcat (intersperse B.linebreak (term:moreterms)) diff --git a/src/Text/Pandoc/Readers/Roff.hs b/src/Text/Pandoc/Readers/Roff.hs index 085dfafd8..11da37953 100644 --- a/src/Text/Pandoc/Readers/Roff.hs +++ b/src/Text/Pandoc/Readers/Roff.hs @@ -247,7 +247,7 @@ escape = do -- \s-1 \s0 escFontSize :: PandocMonad m => RoffLexer m [LinePart] escFontSize = do - let sign = option "" $ ("-" <$ char '-' <|> "" <$ char '+') + let sign = option "" ("-" <$ char '-' <|> "" <$ char '+') let toFontSize xs = case safeRead xs of Nothing -> mzero @@ -420,10 +420,10 @@ tableFormatSpecLine = tableColFormat :: PandocMonad m => RoffLexer m CellFormat tableColFormat = do pipePrefix' <- option False - $ True <$ (try $ string "|" <* notFollowedBy spacetab) + $ True <$ try (string "|" <* notFollowedBy spacetab) c <- oneOf ['a','A','c','C','l','L','n','N','r','R','s','S','^','_','-', '=','|'] - suffixes <- many $ (try $ skipMany spacetab *> count 1 digit) <|> + suffixes <- many $ try (skipMany spacetab *> count 1 digit) <|> (do x <- oneOf ['b','B','d','D','e','E','f','F','i','I','m','M', 'p','P','t','T','u','U','v','V','w','W','x','X', 'z','Z'] num <- case toLower x of @@ -441,7 +441,7 @@ tableColFormat = do , pipePrefix = pipePrefix' , pipeSuffix = pipeSuffix' , columnSuffixes = suffixes } - + -- We don't fully handle the conditional. But we do -- include everything under '.ie n', which occurs commonly -- in man pages. We always skip the '.el' part. -- cgit v1.2.3