aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Odt
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-03-16 12:11:51 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-03-16 12:17:58 -0700
commitf0b6e0ee4970c2338159c376935d375f4aeda1dc (patch)
treea5d344782e5da8b0929af6502cba90025a4fdb3a /src/Text/Pandoc/Readers/Odt
parente21b57991e589d88f50991b87c6ec01d350e9b22 (diff)
downloadpandoc-f0b6e0ee4970c2338159c376935d375f4aeda1dc.tar.gz
Monoid/Semiground cleanup relying on custom Prelude.
Diffstat (limited to 'src/Text/Pandoc/Readers/Odt')
-rw-r--r--src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs6
-rw-r--r--src/Text/Pandoc/Readers/Odt/StyleReader.hs10
2 files changed, 2 insertions, 14 deletions
diff --git a/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs b/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs
index f8ea5c605..03cb82f61 100644
--- a/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs
+++ b/src/Text/Pandoc/Readers/Odt/Generic/Fallible.hs
@@ -39,8 +39,6 @@ compatible instances of "ArrowChoice".
-- We export everything
module Text.Pandoc.Readers.Odt.Generic.Fallible where
-import Data.Monoid ((<>))
-
-- | Default for now. Will probably become a class at some point.
type Failure = ()
@@ -90,7 +88,7 @@ collapseEither (Right (Right x)) = Right x
-- (possibly combined) non-error. If both values represent an error, an error
-- is returned.
chooseMax :: (Monoid a, Monoid b) => Either a b -> Either a b -> Either a b
-chooseMax = chooseMaxWith (<>)
+chooseMax = chooseMaxWith mappend
-- | If either of the values represents a non-error, the result is a
-- (possibly combined) non-error. If both values represent an error, an error
@@ -100,7 +98,7 @@ chooseMaxWith :: (Monoid a) => (b -> b -> b)
-> Either a b
-> Either a b
chooseMaxWith (><) (Right a) (Right b) = Right $ a >< b
-chooseMaxWith _ (Left a) (Left b) = Left $ a <> b
+chooseMaxWith _ (Left a) (Left b) = Left $ a `mappend` b
chooseMaxWith _ (Right a) _ = Right a
chooseMaxWith _ _ (Right b) = Right b
diff --git a/src/Text/Pandoc/Readers/Odt/StyleReader.hs b/src/Text/Pandoc/Readers/Odt/StyleReader.hs
index 1863773cf..477f6b8b7 100644
--- a/src/Text/Pandoc/Readers/Odt/StyleReader.hs
+++ b/src/Text/Pandoc/Readers/Odt/StyleReader.hs
@@ -182,7 +182,6 @@ data Styles = Styles
deriving ( Show )
-- Styles from a monoid under union
-#if MIN_VERSION_base(4,9,0)
instance Semigroup Styles where
(Styles sBn1 dSm1 lsBn1) <> (Styles sBn2 dSm2 lsBn2)
= Styles (M.union sBn1 sBn2)
@@ -191,15 +190,6 @@ instance Semigroup Styles where
instance Monoid Styles where
mempty = Styles M.empty M.empty M.empty
mappend = (<>)
-#else
-instance Monoid Styles where
- mempty = Styles M.empty M.empty M.empty
- mappend (Styles sBn1 dSm1 lsBn1)
- (Styles sBn2 dSm2 lsBn2)
- = Styles (M.union sBn1 sBn2)
- (M.union dSm1 dSm2)
- (M.union lsBn1 lsBn2)
-#endif
-- Not all families from the specifications are implemented, only those we need.
-- But there are none that are not mentioned here.