git.iko.soy/typeable/pagerduty
on develop help sign in
8.6 fixes
1941857mniip
src/Network/PagerDuty/Internal/Types.hs+8−6
@@ -53,7 +53,7 @@ import Network.PagerDuty.Internal.TH
53import Data.Time.Locale.Compat
53import Data.Time.Locale.Compat
54
54
55newtype CSV a = CSV [a]
55newtype CSV a = CSV [a]
56− deriving (Eq, Show, Monoid)
56+ deriving (Eq, Show, Semigroup, Monoid)
57
57
58makePrisms ''CSV
58makePrisms ''CSV
59
59
@@ -70,7 +70,7 @@ instance ToByteString a => ToJSON (CSV a) where
70 toJSON = String . Text.decodeUtf8 . toByteString'
70 toJSON = String . Text.decodeUtf8 . toByteString'
71
71
72newtype List a = L [a]
72newtype List a = L [a]
73− deriving (Eq, Show, Monoid)
73+ deriving (Eq, Show, Semigroup, Monoid)
74
74
75deriveJSON ''List
75deriveJSON ''List
76makePrisms ''List
76makePrisms ''List
@@ -310,11 +310,13 @@ data Path where
310 Path :: Path
310 Path :: Path
311 Seg :: ToByteString a => a -> Path
311 Seg :: ToByteString a => a -> Path
312
312
313+instance Semigroup Path where
314+ x <> Path = x
315+ Path <> y = y
316+ Seg x <> Seg y = Seg (builder x <> "/" <> builder y)
317+
313instance Monoid Path where
318instance Monoid Path where
314− mempty = Path
319+ mempty = Path
315− mappend x Path = x
316− mappend Path y = y
317− mappend (Seg x) (Seg y) = Seg (builder x <> "/" <> builder y)
318
320
319instance IsString Path where
321instance IsString Path where
320 fromString = Seg
322 fromString = Seg