@@ -20,6 +20,8 @@
2020#include "overlapping-compat.h"
2121module Servant.Docs.Internal where
2222
23+import Prelude ()
24+import Prelude.Compat
2325import Control.Applicative
2426import Control.Arrow (second)
2527import Control.Lens (makeLenses, mapped, over, traversed, view, (%~),
@@ -30,9 +32,10 @@ import qualified Data.ByteString.Char8 as BSC
3032import qualified Data.CaseInsensitive as CI
3133import Data.Hashable (Hashable)
3234import Data.HashMap.Strict (HashMap)
33−import Data.List
35+import Data.List.Compat (intercalate, intersperse, sort)
3436import Data.Maybe
35−import Data.Monoid
37+import Data.Monoid (All (..), Any (..), Sum (..), Product (..), First (..), Last (..), Dual (..))
38+import Data.Semigroup (Semigroup (..))
3639import Data.Ord (comparing)
3740import Data.Proxy (Proxy(Proxy))
3841import Data.String.Conversions (cs)
@@ -102,8 +105,11 @@ data API = API
102105 , _apiEndpoints :: HashMap Endpoint Action
103106 } deriving (Eq, Show)
104107
108+instance Semigroup API where
109+ (<>) = mappend
110+
105111instance Monoid API where
106− API a1 b1 `mappend` API a2 b2 = API (a1 <> a2) (b1 <> b2)
112+ API a1 b1 `mappend` API a2 b2 = API (a1 `mappend` a2) (b1 `mappend` b2)
107113 mempty = API mempty mempty
108114
109115-- | An empty 'API'
@@ -162,6 +168,8 @@ data DocNote = DocNote
162168-- These are intended to be built using extraInfo.
163169-- Multiple ExtraInfo may be combined with the monoid instance.
164170newtype ExtraInfo api = ExtraInfo (HashMap Endpoint Action)
171+instance Semigroup (ExtraInfo a) where
172+ (<>) = mappend
165173instance Monoid (ExtraInfo a) where
166174 mempty = ExtraInfo mempty
167175 ExtraInfo a `mappend` ExtraInfo b =