From 1ea5b1802072fe2724977fa859c0e5b48f15917d Mon Sep 17 00:00:00 2001 From: "Joseph C. Sible" Date: Mon, 3 Feb 2020 23:31:05 -0500 Subject: Swap suboptimal uses of maybe and fromMaybe (#6111) Anywhere "maybe" is used with "id" as its second argument, using "fromMaybe" instead will simplify the code. Conversely, anywhere "fromMaybe" is used with the result of "fmap" or "<$>" as its second argument, using "maybe" instead will simplify the code. --- src/Text/Pandoc/Writers/Ms.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Writers/Ms.hs') diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs index b3f4fa1a0..19eb87f89 100644 --- a/src/Text/Pandoc/Writers/Ms.hs +++ b/src/Text/Pandoc/Writers/Ms.hs @@ -26,7 +26,7 @@ import Control.Monad.State.Strict import Data.Char (isLower, isUpper, ord) import Data.List (intercalate, intersperse) import qualified Data.Map as Map -import Data.Maybe (catMaybes, fromMaybe) +import Data.Maybe (catMaybes) import Data.Text (Text) import qualified Data.Text as T import Network.URI (escapeURIString, isAllowedInURI) @@ -507,8 +507,8 @@ toMacro sty toktype = tokSty = Map.lookup toktype (tokenStyles sty) tokCol = (tokSty >>= tokenColor) `mplus` defaultColor sty -- tokBg = (tokSty >>= tokenBackground) `mplus` backgroundColor sty - tokBold = fromMaybe False (tokenBold <$> tokSty) - tokItalic = fromMaybe False (tokenItalic <$> tokSty) + tokBold = maybe False tokenBold tokSty + tokItalic = maybe False tokenItalic tokSty -- tokUnderline = fromMaybe False (tokSty >>= tokUnderline) -- lnColor = lineNumberColor sty -- lnBkgColor = lineNumberBackgroundColor sty -- cgit v1.2.3