git.iko.soy/typeable/pandoc
on master help sign in
Undo the "Use fromRight" hlint hint.
commit0782d5882c8c04fbdffcb7026457b3cc79150692 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 30 Dec 2020, 16:04 (6 years ago) parent4191902
2 files changed+5−2
.hlint.yaml+4 src/Text/Pandoc/Writers/Docx.hs+1−2
.hlint.yaml+4
@@ -104,5 +104,9 @@
104104 - Text.Pandoc.Readers.Markdown
105105 - Text.Pandoc.Readers.RST
106106
107+# fromRight is only in base >= 4.10
108+- ignore:
109+ name: "Use fromRight"
110+
107111# Define some custom infix operators
108112# - fixity: infixr 3 ~^#^~
src/Text/Pandoc/Writers/Docx.hs+1−2
@@ -28,7 +28,6 @@ import Data.Char (isSpace, isLetter)
2828import Data.List (intercalate, isPrefixOf, isSuffixOf)
2929import Data.String (fromString)
3030import qualified Data.Map as M
31−import Data.Either (fromRight)
3231import Data.Maybe (fromMaybe, isNothing, mapMaybe, maybeToList)
3332import qualified Data.Set as Set
3433import qualified Data.Text as T
@@ -1403,7 +1402,7 @@ inlineToOpenXML' opts (Image attr@(imgident, _, _) alt (src, title)) = do
14031402 generateImgElt (ident, _, _, img) =
14041403 let
14051404 (xpt,ypt) = desiredSizeInPoints opts attr
1406− (fromRight def (imageSize opts img))
1405+ (either (const def) id (imageSize opts img))
14071406 -- 12700 emu = 1 pt
14081407 (xemu,yemu) = fitToPage (xpt * 12700, ypt * 12700)
14091408 (pageWidth * 12700)