diff options
author | Christian Despres <50160106+despresc@users.noreply.github.com> | 2020-09-13 10:48:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-13 07:48:14 -0700 |
commit | cae155b095e5182cc1b342b21f7430e40afe7ba8 (patch) | |
tree | 82b6342b0a8dc6f98ce73188bb89ae5ad0267060 /src/Text/Pandoc/Readers/Docx/Parse.hs | |
parent | 2109ded7101dba0ac48c9b60cdf454ad39a7e272 (diff) | |
download | pandoc-cae155b095e5182cc1b342b21f7430e40afe7ba8.tar.gz |
Fix hlint suggestions, update hlint.yaml (#6680)
* Fix hlint suggestions, update hlint.yaml
Most suggestions were redundant brackets. Some required
LambdaCase.
The .hlint.yaml file had a small typo, and didn't ignore camelCase
suggestions in certain modules.
Diffstat (limited to 'src/Text/Pandoc/Readers/Docx/Parse.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/Docx/Parse.hs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs index eab4f4e0d..698d7a88a 100644 --- a/src/Text/Pandoc/Readers/Docx/Parse.hs +++ b/src/Text/Pandoc/Readers/Docx/Parse.hs @@ -404,12 +404,8 @@ archiveToNotes zf = >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry) enElem = findEntryByPath "word/endnotes.xml" zf >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry) - fn_namespaces = case fnElem of - Just e -> elemToNameSpaces e - Nothing -> [] - en_namespaces = case enElem of - Just e -> elemToNameSpaces e - Nothing -> [] + fn_namespaces = maybe [] elemToNameSpaces fnElem + en_namespaces = maybe [] elemToNameSpaces enElem ns = unionBy (\x y -> fst x == fst y) fn_namespaces en_namespaces fn = fnElem >>= walkDocument ns >>= elemToNotes ns "footnote" en = enElem >>= walkDocument ns >>= elemToNotes ns "endnote" @@ -420,9 +416,7 @@ archiveToComments :: Archive -> Comments archiveToComments zf = let cmtsElem = findEntryByPath "word/comments.xml" zf >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry) - cmts_namespaces = case cmtsElem of - Just e -> elemToNameSpaces e - Nothing -> [] + cmts_namespaces = maybe [] elemToNameSpaces cmtsElem cmts = elemToComments cmts_namespaces <$> (cmtsElem >>= walkDocument cmts_namespaces) in case cmts of |