git.iko.soy/typeable/pandoc
on master help sign in
hlint Muse writer
commitdfbae03810b168dc8af3127318918fb13ecbdc55 authorAlexander Krotov <ilabdsf@gmail.com> dateMon 2 Apr 2018, 16:20 (9 years ago) parentca78d93
1 file changed+6−6
src/Text/Pandoc/Writers/Muse.hs+6−6
src/Text/Pandoc/Writers/Muse.hs+6−6
@@ -119,7 +119,7 @@ pandocToMuse (Pandoc meta blocks) = do
119119 (fmap render' . inlineListToMuse)
120120 meta
121121 body <- blockListToMuse blocks
122− notes <- liftM (reverse . stNotes) get >>= notesToMuse
122+ notes <- fmap (reverse . stNotes) get >>= notesToMuse
123123 let main = render colwidth $ body $+$ notes
124124 let context = defField "body" main metadata
125125 case writerTemplate opts of
@@ -222,7 +222,7 @@ blockToMuse (DefinitionList items) = do
222222 -> Muse m Doc
223223 definitionListItemToMuse (label, defs) = do
224224 label' <- inlineListToMuse' label
225− contents <- liftM vcat $ mapM descriptionToMuse defs
225+ contents <- vcat <$> mapM descriptionToMuse defs
226226 let ind = offset label'
227227 return $ hang ind label' contents
228228 descriptionToMuse :: PandocMonad m
@@ -275,7 +275,7 @@ blockToMuse Null = return empty
275275notesToMuse :: PandocMonad m
276276 => Notes
277277 -> Muse m Doc
278−notesToMuse notes = liftM vsep (zipWithM noteToMuse [1 ..] notes)
278+notesToMuse notes = vsep <$> (zipWithM noteToMuse [1 ..] notes)
279279
280280-- | Return Muse representation of a note.
281281noteToMuse :: PandocMonad m
@@ -312,11 +312,11 @@ containsFootnotes st =
312312 p (_:xs) = p xs
313313 p "" = False
314314 q (x:xs)
315− | (x `elem` ("123456789"::String)) = r xs || p xs
315+ | x `elem` ("123456789"::String) = r xs || p xs
316316 | otherwise = p xs
317317 q [] = False
318318 r ('0':xs) = r xs || p xs
319− r (xs) = s xs || q xs || p xs
319+ r xs = s xs || q xs || p xs
320320 s (']':_) = True
321321 s (_:xs) = p xs
322322 s [] = False
@@ -420,7 +420,7 @@ renderInlineList (x:xs) = do
420420 opts <- asks envOptions
421421 let isNewline = (x == SoftBreak && writerWrapText opts == WrapPreserve) || x == LineBreak
422422 lst' <- local (\env -> env { envInlineStart = isNewline
423− , envAfterSpace = (x == Space || (not topLevel && isNewline))
423+ , envAfterSpace = x == Space || (not topLevel && isNewline)
424424 }) $ renderInlineList xs
425425 if start && fixOrEscape afterSpace x
426426 then pure (text "<verbatim></verbatim>" <> r <> lst')