@@ -62,7 +62,7 @@ import Data.Char (isLower, isUpper, toLower)
6262import Data.Data (Data)
6363import Data.HashMap.Strict (HashMap)
6464import Data.Hashable (Hashable(..))
65−import Data.Monoid ((<>))
65+import Data.Semigroup (Semigroup((<>)))
6666import Data.Scientific (Scientific)
6767import Data.String (IsString(..))
6868import Data.Text (Text, pack, unpack)
@@ -190,16 +190,24 @@ instance Alternative Result where
190190 (<|>) = mplus
191191 {-# INLINE (<|>) #-}
192192
193+instance Semigroup (IResult a) where
194+ (<>) = mplus
195+ {-# INLINE (<>) #-}
196+
193197instance Monoid (IResult a) where
194198 mempty = fail "mempty"
195199 {-# INLINE mempty #-}
196− mappend = mplus
200+ mappend = (<>)
197201 {-# INLINE mappend #-}
198202
203+instance Semigroup (Result a) where
204+ (<>) = mplus
205+ {-# INLINE (<>) #-}
206+
199207instance Monoid (Result a) where
200208 mempty = fail "mempty"
201209 {-# INLINE mempty #-}
202− mappend = mplus
210+ mappend = (<>)
203211 {-# INLINE mappend #-}
204212
205213instance Foldable IResult where
@@ -281,10 +289,14 @@ instance MonadPlus Parser where
281289 in runParser a path kf' ks
282290 {-# INLINE mplus #-}
283291
292+instance Semigroup (Parser a) where
293+ (<>) = mplus
294+ {-# INLINE (<>) #-}
295+
284296instance Monoid (Parser a) where
285297 mempty = fail "mempty"
286298 {-# INLINE mempty #-}
287− mappend = mplus
299+ mappend = (<>)
288300 {-# INLINE mappend #-}
289301
290302apP :: Parser (a -> b) -> Parser a -> Parser b
@@ -313,7 +325,7 @@ data Value = Object !Object
313325newtype Encoding = Encoding {
314326 fromEncoding :: Builder
315327 -- ^ Acquire the underlying bytestring builder.
316− } deriving (Monoid)
328+ } deriving (Semigroup,Monoid)
317329
318330instance Show Encoding where
319331 show (Encoding e) = show (toLazyByteString e)
@@ -330,16 +342,18 @@ data Series = Empty
330342 | Value Encoding
331343 deriving (Typeable)
332344
333−instance Monoid Series where
334− mempty = Empty
335−
336− mappend Empty a = a
337− mappend (Value a) b =
345+instance Semigroup Series where
346+ Empty <> a = a
347+ Value a <> b =
338348 Value $
339349 a <> case b of
340350 Empty -> mempty
341351 Value c -> Encoding (char7 ',') <> c
342352
353+instance Monoid Series where
354+ mempty = Empty
355+ mappend = (<>)
356+
343357-- | A newtype wrapper for 'UTCTime' that uses the same non-standard
344358-- serialization format as Microsoft .NET, whose
345359-- <https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx System.DateTime>