@@ -42,6 +42,7 @@ import GHC.Generics
4242import GHC.TypeLits
4343import Servant.API
4444import Servant.API.ContentTypes
45+import Servant.API.TypeLevel
4546import Servant.Utils.Links
4647
4748import qualified Data.HashMap.Strict as HM
@@ -306,15 +307,6 @@ docs p = docsWithOptions p defaultDocOptions
306307docsWithOptions :: HasDocs api => Proxy api -> DocOptions -> API
307308docsWithOptions p = docsFor p (defEndpoint, defAction)
308309
309−-- | Closed type family, check if endpoint is exactly within API.
310−
311−-- We aren't sure what affects how an Endpoint is built up, so we require an
312−-- exact match.
313−type family IsIn (endpoint :: *) (api :: *) :: Constraint where
314− IsIn e (sa :<|> sb) = Or (IsIn e sa) (IsIn e sb)
315− IsIn (e :> sa) (e :> sb) = IsIn sa sb
316− IsIn e e = ()
317−
318310-- | Create an 'ExtraInfo' that is guaranteed to be within the given API layout.
319311--
320312-- The safety here is to ensure that you only add custom documentation to an