git.iko.soy/typeable/pandoc
on master help sign in
Lint code in PRs and when committing to master (#6790)

* Remove unused LANGUAGE pragmata * Apply HLint suggestions * Configure HLint to ignore some warnings * Lint code when committing to master

commit527346cc7e2bc874092be2f6793001860e10a719 authorAlbert Krewinkel <albert@zeitkraut.de> dateSat 7 Nov 2020, 19:38 (6 years ago) parent0ed3436
23 files changed+138−95
.github/workflows/lint.yml+30 .hlint.yaml+74−52 src/Text/Pandoc/Citeproc.hs+1−5 src/Text/Pandoc/Citeproc/MetaValue.hs+1−2 src/Text/Pandoc/Lua/Filter.hs+1−1 src/Text/Pandoc/Readers/BibTeX.hs+1−3 src/Text/Pandoc/Readers/DocBook.hs+1−1 src/Text/Pandoc/Readers/Docx.hs+3−5 src/Text/Pandoc/Readers/Docx/Combine.hs+1−1 src/Text/Pandoc/Readers/EPUB.hs+3−4 src/Text/Pandoc/Readers/Markdown.hs+1−1 src/Text/Pandoc/Readers/Metadata.hs+1−1 src/Text/Pandoc/Readers/Odt/ContentReader.hs+3−2 src/Text/Pandoc/Readers/Odt/Generic/Utils.hs−1 src/Text/Pandoc/Readers/Txt2Tags.hs+1−1 src/Text/Pandoc/Writers/CslJson.hs+3−3 src/Text/Pandoc/Writers/FB2.hs+1−1 src/Text/Pandoc/Writers/HTML.hs+6−5 src/Text/Pandoc/Writers/JATS.hs+1−1 src/Text/Pandoc/Writers/Jira.hs+1−1 src/Text/Pandoc/Writers/Ms.hs+2−2 src/Text/Pandoc/Writers/OpenDocument.hs+1−1 src/Text/Pandoc/Writers/Roff.hs+1−1
.github/workflows/lint.ymlnew file+30
@@ -0,0 +1,30 @@
1+name: Lint
2+
3+# Trigger the workflow on push or pull request, but only for the
4+# master branch
5+on:
6+ pull_request:
7+ branch: [master]
8+ push:
9+ branch: [master]
10+ paths-ignore:
11+ - LICENSE
12+ - README.md
13+ - CHANGELOG.md
14+ - stack.yaml
15+ - .travis.yml
16+
17+jobs:
18+ lint:
19+ name: Lint
20+ runs-on: ubuntu-latest
21+ env:
22+ hlint_script: https://raw.github.com/ndmitchell/hlint/master/misc/run.sh
23+
24+ steps:
25+ - name: Checkout
26+ uses: actions/checkout@v2
27+
28+ - name: Download and run hlint
29+ run: |
30+ curl -sSL "${hlint_script}" | sh -s .
.hlint.yaml+74−52
@@ -2,85 +2,107 @@
22# https://github.com/ndmitchell/hlint
33##########################
44
5−# This file contains a template configuration file, which is typically
6−# placed as .hlint.yaml in the root of your project
7−
8−
95# Specify additional command line arguments
106#
117- arguments: [--color=auto, --cpp-ansi]
128
13−
14−# Control which extensions/flags/modules/functions can be used
15−#
16−# - extensions:
17−# - default: false # all extension are banned by default
18−# - name: [PatternGuards, ViewPatterns] # only these listed extensions can be used
19−# - {name: CPP, within: CrossPlatform} # CPP can only be used in a given module
20−#
21−# - flags:
22−# - {name: -w, within: []} # -w is allowed nowhere
23−#
24−# - modules:
25−# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set'
26−# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
27−#
28−# - functions:
29−# - {name: unsafePerformIO, within: []} # unsafePerformIO can only appear in no modules
30−
31−
32−# Add custom hints for this project
33−#
34−# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
35−# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}
36−
37−
38−# Turn on hints that are off by default
39−#
40−# Ban "module X(module X) where", to require a real export list
41−# - warn: {name: Use explicit module export list}
42−#
43−# Replace a $ b $ c with a . b $ c
44−# - group: {name: dollar, enabled: true}
45−#
46−# Generalise map to fmap, ++ to <>
47−# - group: {name: generalise, enabled: true}
48−
49−
509# Ignore some builtin hints
51−# - ignore: {name: Use let}
52−# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
53−# - ignore: {name: "Use section"}
54−# - ignore: {name: "Use camelCase"}
55−# - ignore: {name: "Use list comprehension"}
56−# - ignore: {name: "Redundant if"}
10+#
5711- ignore: {name: "Avoid lambda"}
5812- ignore: {name: "Eta reduce"}
5913- ignore: {name: "Evaluate"}
60−- ignore: {name: "Monad law, left identity", module: "Text.Pandoc.App.OutputSettings"}
61−- ignore: {name: "Reduce duplication", module: "Text.Pandoc.Readers.Markdown"}
14+- ignore: {name: "Reduce duplication"} # TODO: could be more fine-grained
6215- ignore: {name: "Use &&&"}
6316- ignore: {name: "Use String"}
6417- ignore: {name: "Use fmap"} # specific for GHC 7.8 compat
65−- ignore: {name: "Use forM_", module: "Text.Pandoc.Readers.DocBook"}
6618- ignore: {name: "Use isDigit"}
67−- ignore: {name: "Use tuple-section", module: "Text.Pandoc.Readers.EPUB"}
68−- ignore: {name: "Use uncurry", module: "Text.Pandoc.Readers.Docx.Combine"}
19+
20+- ignore:
21+ name: "Monad law, left identity"
22+ within: Text.Pandoc.App.OutputSettings
23+
24+- ignore:
25+ name: "Move brackets to avoid $"
26+ within: Text.Pandoc.Writers.CslJson
27+
28+- ignore:
29+ name: "Redundant <$>"
30+ within:
31+ - Text.Pandoc.Readers.Docx.Parse
32+ - Text.Pandoc.Writers.MediaWiki
33+ - Text.Pandoc.Writers.OpenDocument
34+ - Text.Pandoc.Writers.Powerpoint.Output
35+ - Text.Pandoc.Writers.Powerpoint.Presentation
36+
37+- ignore:
38+ name: "Redundant return"
39+ within: Text.Pandoc.Citeproc.BibTeX
40+
41+# TODO: check
42+- ignore:
43+ name: "Redundant bracket"
44+ within:
45+ - Text.Pandoc.Citeproc
46+ - Text.Pandoc.Citeproc.BibTeX
47+ - Text.Pandoc.Citeproc.MetaValue
48+
6949- ignore:
7050 name: "Use <$>"
7151 within:
7252 - Text.Pandoc.Readers.LaTeX
7353 - Text.Pandoc.Readers.Markdown
54+
7455- ignore:
7556 name: "Use camelCase"
7657 within:
7758 - Tests.Writers.Docbook
7859 - Tests.Writers.Native
60+ - Text.Pandoc.Citeproc
7961 - Text.Pandoc.Extensions
8062 - Text.Pandoc.Lua.Marshaling.Version
8163 - Text.Pandoc.Lua.Module.Utils
8264 - Text.Pandoc.Readers.Odt.ContentReader
8365 - Text.Pandoc.Readers.Odt.Namespaces
8466
67+- ignore:
68+ name: "Use forM_"
69+ within:
70+ - Text.Pandoc.Readers.DocBook
71+
72+- ignore:
73+ name: "Use Just"
74+ within:
75+ - Text.Pandoc.Citeproc.MetaValue
76+ - Text.Pandoc.Readers.Odt.ContentReader
77+ - Text.Pandoc.Writers.Roff
78+
79+- ignore:
80+ name: "Use list comprehension"
81+ within: Text.Pandoc.Citeproc.BibTeX
82+
83+- ignore:
84+ name: "Use list literal pattern"
85+ within: Text.Pandoc.Citeproc.MetaValue
86+
87+# TODO: check
88+- ignore:
89+ name: "Use second"
90+ within:
91+ - Text.Pandoc.Citeproc.BibTeX
92+ - Text.Pandoc.Citeproc.Locator
93+
94+# TODO: check
95+- ignore:
96+ name: "Use sortOn"
97+ within: Text.Pandoc.Writers.OpenDocument
98+
99+- ignore:
100+ name: "Use tuple-section"
101+ within:
102+ - Text.Pandoc.Readers.EPUB
103+ - Text.Pandoc.ImageSize
104+ - Text.Pandoc.Readers.Markdown
105+ - Text.Pandoc.Readers.RST
106+
85107# Define some custom infix operators
86108# - fixity: infixr 3 ~^#^~
src/Text/Pandoc/Citeproc.hs+1−5
@@ -1,18 +1,14 @@
11{-# LANGUAGE ScopedTypeVariables #-}
22{-# LANGUAGE FlexibleContexts #-}
3−{-# LANGUAGE ViewPatterns #-}
43{-# LANGUAGE StrictData #-}
54{-# LANGUAGE MultiParamTypeClasses #-}
65{-# LANGUAGE FlexibleInstances #-}
76{-# LANGUAGE OverloadedStrings #-}
8−{-# LANGUAGE DeriveFunctor #-}
9−{-# LANGUAGE DeriveFoldable #-}
10−{-# LANGUAGE DeriveTraversable #-}
117module Text.Pandoc.Citeproc
128 ( processCitations )
139where
1410
15−import Citeproc as Citeproc
11+import Citeproc
1612import Citeproc.Pandoc ()
1713import Text.Pandoc.Citeproc.Locator (parseLocator)
1814import Text.Pandoc.Citeproc.CslJson (cslJsonToReferences)
src/Text/Pandoc/Citeproc/MetaValue.hs+1−2
@@ -147,7 +147,7 @@ metaValueToDate (MetaMap m) =
147147 mapMaybe metaValueToDateParts xs
148148 Just _ -> []
149149 Nothing ->
150− maybe [] (:[]) $ metaValueToDateParts (MetaMap m)
150+ maybeToList $ metaValueToDateParts (MetaMap m)
151151 circa = fromMaybe False $
152152 M.lookup "circa" m >>= metaValueToBool
153153 season = M.lookup "season" m >>= metaValueToInt
@@ -251,4 +251,3 @@ normalizeKey k =
251251 "pmid" -> "PMID"
252252 "url" -> "URL"
253253 x -> x
254−
src/Text/Pandoc/Lua/Filter.hs+1−1
@@ -160,7 +160,7 @@ mconcatMapM :: (Monad m) => (a -> m [a]) -> [a] -> m [a]
160160mconcatMapM f = fmap mconcat . mapM f
161161
162162hasOneOf :: LuaFilter -> [String] -> Bool
163−hasOneOf (LuaFilter fnMap) = any (\k -> Map.member k fnMap)
163+hasOneOf (LuaFilter fnMap) = any (`Map.member` fnMap)
164164
165165contains :: LuaFilter -> String -> Bool
166166contains (LuaFilter fnMap) = (`Map.member` fnMap)
src/Text/Pandoc/Readers/BibTeX.hs+1−3
@@ -26,7 +26,6 @@ import Text.Pandoc.Builder (setMeta, cite, str)
2626import Data.Text (Text)
2727import Citeproc (Lang(..), parseLang)
2828import Citeproc.Locale (getLocale)
29−import Data.Maybe (fromMaybe)
3029import Text.Pandoc.Error (PandocError(..))
3130import Text.Pandoc.Class (PandocMonad, lookupEnv)
3231import Text.Pandoc.Citeproc.BibTeX as BibTeX
@@ -49,7 +48,7 @@ readBibLaTeX = readBibTeX' BibTeX.Biblatex
4948
5049readBibTeX' :: PandocMonad m => Variant -> ReaderOptions -> Text -> m Pandoc
5150readBibTeX' variant _opts t = do
52− lang <- fromMaybe (Lang "en" (Just "US")) . fmap parseLang
51+ lang <- maybe (Lang "en" (Just "US")) parseLang
5352 <$> lookupEnv "LANG"
5453 locale <- case getLocale lang of
5554 Left e -> throwError $ PandocCiteprocError e
@@ -67,4 +66,3 @@ readBibTeX' variant _opts t = do
6766 , citationHash = 0}]
6867 (str "[@*]"))
6968 $ Pandoc nullMeta []
70−
src/Text/Pandoc/Readers/DocBook.hs+1−1
@@ -1046,7 +1046,7 @@ parseEntry cn el = do
10461046 _ -> 1
10471047 let colSpan = toColSpan el
10481048 let align = toAlignment el
1049− (fmap (cell align 1 colSpan) . (parseMixed plain) . elContent) el
1049+ (fmap (cell align 1 colSpan) . parseMixed plain . elContent) el
10501050
10511051getInlines :: PandocMonad m => Element -> DB m Inlines
10521052getInlines e' = trimInlines . mconcat <$>
src/Text/Pandoc/Readers/Docx.hs+3−5
@@ -1,7 +1,6 @@
11{-# LANGUAGE CPP #-}
22{-# LANGUAGE OverloadedStrings #-}
33{-# LANGUAGE PatternGuards #-}
4−{-# LANGUAGE MultiWayIf #-}
54{-# LANGUAGE FlexibleContexts #-}
65{-# LANGUAGE ViewPatterns #-}
76{- |
@@ -417,7 +416,7 @@ parPartToInlines' (BookMark _ anchor) =
417416 (modify $ \s -> s { docxAnchorMap = M.insert anchor prevAnchor anchorMap})
418417 return mempty
419418 Nothing -> do
420− exts <- readerExtensions <$> asks docxOptions
419+ exts <- asks (readerExtensions . docxOptions)
421420 let newAnchor =
422421 if not inHdrBool && anchor `elem` M.elems anchorMap
423422 then uniqueIdent exts [Str anchor]
@@ -462,7 +461,7 @@ makeHeaderAnchor' (Header n (ident, classes, kvs) ils)
462461 | (c:_) <- filter isAnchorSpan ils
463462 , (Span (anchIdent, ["anchor"], _) cIls) <- c = do
464463 hdrIDMap <- gets docxAnchorMap
465− exts <- readerExtensions <$> asks docxOptions
464+ exts <- asks (readerExtensions . docxOptions)
466465 let newIdent = if T.null ident
467466 then uniqueIdent exts ils (Set.fromList $ M.elems hdrIDMap)
468467 else ident
@@ -475,7 +474,7 @@ makeHeaderAnchor' (Header n (ident, classes, kvs) ils)
475474makeHeaderAnchor' (Header n (ident, classes, kvs) ils) =
476475 do
477476 hdrIDMap <- gets docxAnchorMap
478− exts <- readerExtensions <$> asks docxOptions
477+ exts <- asks (readerExtensions . docxOptions)
479478 let newIdent = if T.null ident
480479 then uniqueIdent exts ils (Set.fromList $ M.elems hdrIDMap)
481480 else ident
@@ -736,4 +735,3 @@ docxToOutput opts (Docx (Document _ body)) =
736735addAuthorAndDate :: T.Text -> Maybe T.Text -> [(T.Text, T.Text)]
737736addAuthorAndDate author mdate =
738737 ("author", author) : maybe [] (\date -> [("date", date)]) mdate
739−
src/Text/Pandoc/Readers/Docx/Combine.hs+1−1
@@ -109,7 +109,7 @@ ilModifierAndInnards ils = case viewl $ unMany ils of
109109 Underline lst -> Just (Modifier underline, lst)
110110 Superscript lst -> Just (Modifier superscript, lst)
111111 Subscript lst -> Just (Modifier subscript, lst)
112− Link attr lst tgt -> Just (Modifier $ linkWith attr (fst tgt) (snd tgt), lst)
112+ Link attr lst tgt -> Just (Modifier $ uncurry (linkWith attr) tgt, lst)
113113 Span attr lst -> Just (AttrModifier spanWith attr, lst)
114114 _ -> Nothing
115115 _ -> Nothing
src/Text/Pandoc/Readers/EPUB.hs+3−4
@@ -26,7 +26,7 @@ import qualified Data.ByteString.Lazy as BL (ByteString)
2626import Data.List (isInfixOf)
2727import qualified Data.Text as T
2828import qualified Data.Map as M (Map, elems, fromList, lookup)
29−import Data.Maybe (fromMaybe, mapMaybe)
29+import Data.Maybe (mapMaybe)
3030import qualified Data.Text.Lazy as TL
3131import qualified Data.Text.Lazy.Encoding as TL
3232import Network.URI (unEscapeString)
@@ -139,8 +139,7 @@ parseManifest content coverId = do
139139 where
140140 findCover e = maybe False (isInfixOf "cover-image")
141141 (findAttr (emptyName "properties") e)
142− || fromMaybe False
143− (liftM2 (==) coverId (findAttr (emptyName "id") e))
142+ || Just True == liftM2 (==) coverId (findAttr (emptyName "id") e)
144143 parseItem e = do
145144 uid <- findAttrE (emptyName "id") e
146145 href <- findAttrE (emptyName "href") e
@@ -191,7 +190,7 @@ getManifest archive = do
191190 let rootdir = dropFileName manifestFile
192191 --mime <- lookup "media-type" as
193192 manifest <- findEntryByPathE manifestFile archive
194− fmap ((,) rootdir) (parseXMLDocE . UTF8.toStringLazy . fromEntry $ manifest)
193+ (rootdir,) <$> (parseXMLDocE . UTF8.toStringLazy . fromEntry $ manifest)
195194
196195-- Fixup
197196
src/Text/Pandoc/Readers/Markdown.hs+1−1
@@ -1918,7 +1918,7 @@ note = try $ do
19181918 -- notes, to avoid infinite looping with notes inside
19191919 -- notes:
19201920 let contents' = runF contents st{ stateNotes' = M.empty }
1921− let addCitationNoteNum (c@Citation{}) =
1921+ let addCitationNoteNum c@Citation{} =
19221922 c{ citationNoteNum = noteNum }
19231923 let adjustCite (Cite cs ils) =
19241924 Cite (map addCitationNoteNum cs) ils
src/Text/Pandoc/Readers/Metadata.hs+1−1
@@ -70,7 +70,7 @@ yamlBsToRefs :: PandocMonad m
7070 -> ParserT Text ParserState m (F [MetaValue])
7171yamlBsToRefs pMetaValue idpred bstr =
7272 case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of
73− Right (YAML.Doc o@(YAML.Mapping _ _ _):_)
73+ Right (YAML.Doc o@YAML.Mapping{}:_)
7474 -> case lookupYAML "references" o of
7575 Just (YAML.Sequence _ _ ns) -> do
7676 let g n = case lookupYAML "id" n of
src/Text/Pandoc/Readers/Odt/ContentReader.hs+3−2
@@ -25,6 +25,7 @@ module Text.Pandoc.Readers.Odt.ContentReader
2525
2626import Control.Applicative hiding (liftA, liftA2, liftA3)
2727import Control.Arrow
28+import Control.Monad ((<=<))
2829
2930import qualified Data.ByteString.Lazy as B
3031import Data.Foldable (fold)
@@ -352,11 +353,11 @@ modifierFromStyleDiff propertyTriple =
352353
353354 lookupPreviousValue f = lookupPreviousStyleValue (fmap f . textProperties)
354355
355− lookupPreviousValueM f = lookupPreviousStyleValue ((f =<<).textProperties)
356+ lookupPreviousValueM f = lookupPreviousStyleValue (f <=< textProperties)
356357
357358 lookupPreviousStyleValue f (ReaderState{..},_,mFamily)
358359 = findBy f (extendedStylePropertyChain styleTrace styleSet)
359− <|> ( f =<< fmap (lookupDefaultStyle' styleSet) mFamily )
360+ <|> (f . lookupDefaultStyle' styleSet =<< mFamily)
360361
361362
362363type ParaModifier = Blocks -> Blocks
src/Text/Pandoc/Readers/Odt/Generic/Utils.hs−1
@@ -1,4 +1,3 @@
1−{-# LANGUAGE TypeOperators #-}
21{-# LANGUAGE ViewPatterns #-}
32{- |
43 Module : Text.Pandoc.Reader.Odt.Generic.Utils
src/Text/Pandoc/Readers/Txt2Tags.hs+1−1
@@ -464,7 +464,7 @@ macro = try $ do
464464 name <- string "%%" *> oneOfStringsCI (map fst commands)
465465 optional (try $ enclosed (char '(') (char ')') anyChar)
466466 lookAhead (spaceChar <|> oneOf specialChars <|> newline)
467− maybe (return mempty) (\f -> B.str <$> asks f) (lookup name commands)
467+ maybe (return mempty) (\f -> asks (B.str . f)) (lookup name commands)
468468 where
469469 commands = [ ("date", date), ("mtime", mtime)
470470 , ("infile", T.pack . infile), ("outfile", T.pack . outfile)]
src/Text/Pandoc/Writers/CslJson.hs+3−3
@@ -34,15 +34,15 @@ import Control.Monad.Identity
3434import Citeproc.Locale (getLocale)
3535import Citeproc.CslJson
3636import Text.Pandoc.Options (WriterOptions)
37−import Data.Maybe (fromMaybe, mapMaybe)
37+import Data.Maybe (mapMaybe)
3838import Data.Aeson.Encode.Pretty (Config (..), Indent (Spaces),
3939 NumberFormat (Generic),
4040 defConfig, encodePretty')
4141
4242writeCslJson :: PandocMonad m => WriterOptions -> Pandoc -> m Text
4343writeCslJson _opts (Pandoc meta _) = do
44− let lang = fromMaybe (Lang "en" (Just "US")) $
45− parseLang <$> (lookupMeta "lang" meta >>= metaValueToText)
44+ let lang = maybe (Lang "en" (Just "US")) parseLang
45+ (lookupMeta "lang" meta >>= metaValueToText)
4646 locale <- case getLocale lang of
4747 Left e -> throwError $ PandocCiteprocError e
4848 Right l -> return l
src/Text/Pandoc/Writers/FB2.hs+1−1
@@ -83,7 +83,7 @@ pandocToFB2 opts (Pandoc meta blocks) = do
8383 secs <- renderSections 1 blocks
8484 let body = el "body" $ el "title" (el "p" title) : secs
8585 notes <- renderFootnotes
86− (imgs,missing) <- fmap imagesToFetch get >>= \s -> lift (fetchImages s)
86+ (imgs,missing) <- get >>= (lift . fetchImages . imagesToFetch)
8787 let body' = replaceImagesWithAlt missing body
8888 let fb2_xml = el "FictionBook" (fb2_attrs, [desc, body'] ++ notes ++ imgs)
8989 return $ pack $ xml_head ++ showContent fb2_xml ++ "\n"
src/Text/Pandoc/Writers/HTML.hs+6−5
@@ -314,7 +314,7 @@ pandocToHtml opts (Pandoc meta blocks) = do
314314 "/*]]>*/\n")
315315 | otherwise -> mempty
316316 Nothing -> mempty
317− let mCss :: Maybe [Text] = lookupContext "css" $ metadata
317+ let mCss :: Maybe [Text] = lookupContext "css" metadata
318318 let context = (if stHighlighting st
319319 then case writerHighlightStyle opts of
320320 Just sty -> defField "highlighting-css"
@@ -1290,8 +1290,9 @@ inlineToHtml opts inline = do
12901290 | any ((=="cite") . fst) kvs
12911291 -> (Just attr, cs)
12921292 cs -> (Nothing, cs)
1293− H.q `fmap` inlineListToHtml opts lst'
1294− >>= maybe return (addAttrs opts) maybeAttr
1293+ let addAttrsMb = maybe return (addAttrs opts)
1294+ inlineListToHtml opts lst' >>=
1295+ addAttrsMb maybeAttr . H.q
12951296 else (\x -> leftQuote >> x >> rightQuote)
12961297 `fmap` inlineListToHtml opts lst
12971298 (Math t str) -> do
@@ -1468,8 +1469,8 @@ cslEntryToHtml :: PandocMonad m
14681469cslEntryToHtml opts (Para xs) = do
14691470 html5 <- gets stHtml5
14701471 let inDiv :: Text -> Html -> Html
1471− inDiv cls x = ((if html5 then H5.div else H.div)
1472− x ! A.class_ (toValue cls))
1472+ inDiv cls x = (if html5 then H5.div else H.div)
1473+ x ! A.class_ (toValue cls)
14731474 let go (Span ("",[cls],[]) ils)
14741475 | cls == "csl-block" || cls == "csl-left-margin" ||
14751476 cls == "csl-right-inline" || cls == "csl-indent"
src/Text/Pandoc/Writers/JATS.hs+1−1
@@ -108,7 +108,7 @@ docToJATS opts (Pandoc meta blocks) = do
108108 (fmap chomp . inlinesToJATS opts)
109109 meta
110110 main <- fromBlocks bodyblocks
111− notes <- reverse . map snd <$> gets jatsNotes
111+ notes <- gets (reverse . map snd . jatsNotes)
112112 backs <- fromBlocks backblocks
113113 tagSet <- ask
114114 -- In the "Article Authoring" tag set, occurrence of fn-group elements
src/Text/Pandoc/Writers/Jira.hs+1−1
@@ -194,7 +194,7 @@ toJiraInlines inlines = do
194194 Jira.Monospaced (escapeSpecialChars cs)
195195 Emph xs -> styled Jira.Emphasis xs
196196 Underline xs -> styled Jira.Insert xs
197− Image attr cap tgt -> imageToJira attr cap (fst tgt) (snd tgt)
197+ Image attr cap tgt -> uncurry (imageToJira attr cap) tgt
198198 LineBreak -> pure . singleton $ Jira.Linebreak
199199 Link attr xs tgt -> toJiraLink attr tgt xs
200200 Math mtype cs -> mathToJira mtype cs
src/Text/Pandoc/Writers/Ms.hs+2−2
@@ -489,8 +489,8 @@ cslEntryToMs atStart opts (Para xs) =
489489 | otherwise
490490 -> case xs of
491491 [] -> return mempty
492− (x:rest) -> (<>) <$> (inlineToMs opts x)
493− <*> (cslEntryToMs False opts (Para rest))
492+ (x:rest) -> (<>) <$> inlineToMs opts x
493+ <*> cslEntryToMs False opts (Para rest)
494494cslEntryToMs _ opts x = blockToMs opts x
495495
496496
src/Text/Pandoc/Writers/OpenDocument.hs+1−1
@@ -601,7 +601,7 @@ inlineToOpenDocument o ils
601601 formatOpenDocument _fmtOpts = map (map toHlTok)
602602 toHlTok :: Token -> Doc Text
603603 toHlTok (toktype,tok) =
604− inTags False "text:span" [("text:style-name", (T.pack $ show toktype))] $ preformatted tok
604+ inTags False "text:span" [("text:style-name", T.pack $ show toktype)] $ preformatted tok
605605 unhighlighted s = inlinedCode $ preformatted s
606606 preformatted s = handleSpaces $ escapeStringForXML s
607607 inlinedCode s = return $ inTags False "text:span" [("text:style-name", "Source_Text")] s
src/Text/Pandoc/Writers/Roff.hs+1−1
@@ -90,7 +90,7 @@ escapeString e = Text.concat . escapeString' e . Text.unpack
9090 AllowUTF8 -> Text.singleton x : escapeString' escapeMode xs
9191 AsciiOnly ->
9292 let accents = catMaybes $ takeWhile isJust
93− (map (\c -> Map.lookup c combiningAccentsMap) xs)
93+ (map (`Map.lookup` combiningAccentsMap) xs)
9494 rest = drop (length accents) xs
9595 s = case Map.lookup x characterCodeMap of
9696 Just t -> "\\[" <> Text.unwords (t:accents) <> "]"