@@ -51,14 +51,14 @@ pandocToMan opts (Pandoc meta blocks) = do
5151 let after = writerIncludeAfter opts
5252 let before' = if null before then empty else text before
5353 let after' = if null after then empty else text after
54− (head, foot) <- metaToMan opts meta
54+ (head', foot) <- metaToMan opts meta
5555 body <- blockListToMan opts blocks
5656 (notes, preprocessors) <- get
5757 let preamble = if null preprocessors || not (writerStandalone opts)
5858 then empty
5959 else text $ ".\\\" " ++ concat (nub preprocessors)
6060 notes' <- notesToMan opts (reverse notes)
61− return $ preamble $$ head $$ before' $$ body $$ notes' $$ foot $$ after'
61+ return $ preamble $$ head' $$ before' $$ body $$ notes' $$ foot $$ after'
6262
6363-- | Insert bibliographic information into Man header and footer.
6464metaToMan :: WriterOptions -- ^ Options, including Man header
@@ -73,14 +73,14 @@ metaToMan options (Meta title authors date) = do
7373 xs -> (text (reverse xs), doubleQuotes empty)
7474 let extras = map (doubleQuotes . text . removeLeadingTrailingSpace) $
7575 splitBy '|' rest
76− let head = (text ".TH") <+> title' <+> section <+>
76+ let head' = (text ".TH") <+> title' <+> section <+>
7777 doubleQuotes (text date) <+> hsep extras
7878 let foot = case length authors of
7979 0 -> empty
8080 1 -> text ".SH AUTHOR" $$ (text $ joinWithSep ", " authors)
8181 _ -> text ".SH AUTHORS" $$ (text $ joinWithSep ", " authors)
8282 return $ if writerStandalone options
83− then (head, foot)
83+ then (head', foot)
8484 else (empty, empty)
8585
8686-- | Return man representation of notes.
@@ -114,21 +114,21 @@ escapeCode = escapeStringUsing (manEscapes ++ backslashEscapes "\t ")
114114blockToMan :: WriterOptions -- ^ Options
115115 -> Block -- ^ Block element
116116 -> State WriterState Doc
117−blockToMan opts Null = return empty
117+blockToMan _ Null = return empty
118118blockToMan opts (Plain inlines) =
119119 wrapIfNeeded opts (inlineListToMan opts) inlines
120120blockToMan opts (Para inlines) = do
121121 contents <- wrapIfNeeded opts (inlineListToMan opts) inlines
122122 return $ text ".PP" $$ contents
123−blockToMan opts (RawHtml str) = return $ text str
124−blockToMan opts HorizontalRule = return $ text $ ".PP\n * * * * *"
123+blockToMan _ (RawHtml str) = return $ text str
124+blockToMan _ HorizontalRule = return $ text $ ".PP\n * * * * *"
125125blockToMan opts (Header level inlines) = do
126126 contents <- inlineListToMan opts inlines
127127 let heading = case level of
128128 1 -> ".SH "
129129 _ -> ".SS "
130130 return $ text heading <> contents
131−blockToMan opts (CodeBlock _ str) = return $
131+blockToMan _ (CodeBlock _ str) = return $
132132 text ".PP" $$ text "\\f[CR]" $$
133133 text ((unlines . map (" " ++) . lines) (escapeCode str)) <> text "\\f[]"
134134blockToMan opts (BlockQuote blocks) = do
@@ -174,7 +174,7 @@ blockToMan opts (DefinitionList items) = do
174174
175175-- | Convert bullet list item (list of blocks) to man.
176176bulletListItemToMan :: WriterOptions -> [Block] -> State WriterState Doc
177−bulletListItemToMan opts [] = return empty
177+bulletListItemToMan _ [] = return empty
178178bulletListItemToMan opts ((Para first):rest) =
179179 bulletListItemToMan opts ((Plain first):rest)
180180bulletListItemToMan opts ((Plain first):rest) = do
@@ -219,8 +219,9 @@ definitionListItemToMan opts (label, items) = do
219219 then return empty
220220 else do
221221 let (first, rest) = case items of
222− ((Para x):y) -> (Plain x,y)
223− (x:y) -> (x,y)
222+ ((Para x):y) -> (Plain x,y)
223+ (x:y) -> (x,y)
224+ [] -> error "items is null"
224225 rest' <- mapM (\item -> blockToMan opts item)
225226 rest >>= (return . vcat)
226227 first' <- blockToMan opts first
@@ -261,18 +262,18 @@ inlineToMan opts (Quoted SingleQuote lst) = do
261262inlineToMan opts (Quoted DoubleQuote lst) = do
262263 contents <- inlineListToMan opts lst
263264 return $ text "\\[lq]" <> contents <> text "\\[rq]"
264−inlineToMan opts EmDash = return $ text "\\[em]"
265−inlineToMan opts EnDash = return $ text "\\[en]"
266−inlineToMan opts Apostrophe = return $ char '\''
267−inlineToMan opts Ellipses = return $ text "\\&..."
268−inlineToMan opts (Code str) =
265+inlineToMan _ EmDash = return $ text "\\[em]"
266+inlineToMan _ EnDash = return $ text "\\[en]"
267+inlineToMan _ Apostrophe = return $ char '\''
268+inlineToMan _ Ellipses = return $ text "\\&..."
269+inlineToMan _ (Code str) =
269270 return $ text $ "\\f[B]" ++ escapeCode str ++ "\\f[]"
270−inlineToMan opts (Str str) = return $ text $ escapeString str
271+inlineToMan _ (Str str) = return $ text $ escapeString str
271272inlineToMan opts (Math str) = inlineToMan opts (Code str)
272−inlineToMan opts (TeX str) = return empty
273−inlineToMan opts (HtmlInline str) = return $ text $ escapeCode str
274−inlineToMan opts (LineBreak) = return $ text "\n.PD 0\n.P\n.PD\n"
275−inlineToMan opts Space = return $ char ' '
273+inlineToMan _ (TeX _) = return empty
274+inlineToMan _ (HtmlInline str) = return $ text $ escapeCode str
275+inlineToMan _ (LineBreak) = return $ text "\n.PD 0\n.P\n.PD\n"
276+inlineToMan _ Space = return $ char ' '
276277inlineToMan opts (Link txt (src, _)) = do
277278 linktext <- inlineListToMan opts txt
278279 let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src
@@ -286,7 +287,7 @@ inlineToMan opts (Image alternate (source, tit)) = do
286287 else alternate
287288 linkPart <- inlineToMan opts (Link txt (source, tit))
288289 return $ char '[' <> text "IMAGE: " <> linkPart <> char ']'
289−inlineToMan opts (Note contents) = do
290+inlineToMan _ (Note contents) = do
290291 modify (\(notes, prep) -> (contents:notes, prep)) -- add to notes in state
291292 (notes, _) <- get
292293 let ref = show $ (length notes)