@@ -163,7 +163,7 @@ data DocNote = DocNote
163163--
164164-- These are intended to be built using extraInfo.
165165-- Multiple ExtraInfo may be combined with the monoid instance.
166−newtype ExtraInfo layout = ExtraInfo (HashMap Endpoint Action)
166+newtype ExtraInfo api = ExtraInfo (HashMap Endpoint Action)
167167instance Monoid (ExtraInfo a) where
168168 mempty = ExtraInfo mempty
169169 ExtraInfo a `mappend` ExtraInfo b =
@@ -300,11 +300,11 @@ makeLenses ''Action
300300-- default way to create documentation.
301301--
302302-- prop> docs == docsWithOptions defaultDocOptions
303−docs :: HasDocs layout => Proxy layout -> API
303+docs :: HasDocs api => Proxy api -> API
304304docs p = docsWithOptions p defaultDocOptions
305305
306306-- | Generate the docs for a given API that implements 'HasDocs'.
307−docsWithOptions :: HasDocs layout => Proxy layout -> DocOptions -> API
307+docsWithOptions :: HasDocs api => Proxy api -> DocOptions -> API
308308docsWithOptions p = docsFor p (defEndpoint, defAction)
309309
310310-- | Closed type family, check if endpoint is exactly within API.
@@ -316,7 +316,7 @@ type family IsIn (endpoint :: *) (api :: *) :: Constraint where
316316 IsIn (e :> sa) (e :> sb) = IsIn sa sb
317317 IsIn e e = ()
318318
319−-- | Create an 'ExtraInfo' that is garunteed to be within the given API layout.
319+-- | Create an 'ExtraInfo' that is guaranteed to be within the given API layout.
320320--
321321-- The safety here is to ensure that you only add custom documentation to an
322322-- endpoint that actually exists within your API.
@@ -329,8 +329,8 @@ type family IsIn (endpoint :: *) (api :: *) :: Constraint where
329329-- > , DocNote "Second secton" ["And some more"]
330330-- > ]
331331
332−extraInfo :: (IsIn endpoint layout, HasLink endpoint, HasDocs endpoint)
333− => Proxy endpoint -> Action -> ExtraInfo layout
332+extraInfo :: (IsIn endpoint api, HasLink endpoint, HasDocs endpoint)
333+ => Proxy endpoint -> Action -> ExtraInfo api
334334extraInfo p action =
335335 let api = docsFor p (defEndpoint, defAction) defaultDocOptions
336336 -- Assume one endpoint, HasLink constraint means that we should only ever
@@ -349,7 +349,7 @@ extraInfo p action =
349349-- 'extraInfo'.
350350--
351351-- If you only want to add an introduction, use 'docsWithIntros'.
352−docsWith :: HasDocs layout => DocOptions -> [DocIntro] -> ExtraInfo layout -> Proxy layout -> API
352+docsWith :: HasDocs api => DocOptions -> [DocIntro] -> ExtraInfo api -> Proxy api -> API
353353docsWith opts intros (ExtraInfo endpoints) p =
354354 docsWithOptions p opts
355355 & apiIntros <>~ intros
@@ -358,13 +358,13 @@ docsWith opts intros (ExtraInfo endpoints) p =
358358
359359-- | Generate the docs for a given API that implements 'HasDocs' with with any
360360-- number of introduction(s)
361−docsWithIntros :: HasDocs layout => [DocIntro] -> Proxy layout -> API
361+docsWithIntros :: HasDocs api => [DocIntro] -> Proxy api -> API
362362docsWithIntros intros = docsWith defaultDocOptions intros mempty
363363
364364-- | The class that abstracts away the impact of API combinators
365365-- on documentation generation.
366−class HasDocs layout where
367− docsFor :: Proxy layout -> (Endpoint, Action) -> DocOptions -> API
366+class HasDocs api where
367+ docsFor :: Proxy api -> (Endpoint, Action) -> DocOptions -> API
368368
369369-- | The class that lets us display a sample input or output in the supported
370370-- content-types when generating documentation for endpoints that either:
@@ -675,26 +675,26 @@ markdown api = unlines $
675675-- | The generated docs for @a ':<|>' b@ just appends the docs
676676-- for @a@ with the docs for @b@.
677677instance OVERLAPPABLE_
678− (HasDocs layout1, HasDocs layout2)
679− => HasDocs (layout1 :<|> layout2) where
678+ (HasDocs a, HasDocs b)
679+ => HasDocs (a :<|> b) where
680680
681681 docsFor Proxy (ep, action) = docsFor p1 (ep, action) <> docsFor p2 (ep, action)
682682
683− where p1 :: Proxy layout1
683+ where p1 :: Proxy a
684684 p1 = Proxy
685685
686− p2 :: Proxy layout2
686+ p2 :: Proxy b
687687 p2 = Proxy
688688
689689-- | @"books" :> 'Capture' "isbn" Text@ will appear as
690690-- @/books/:isbn@ in the docs.
691−instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs sublayout)
692− => HasDocs (Capture sym a :> sublayout) where
691+instance (KnownSymbol sym, ToCapture (Capture sym a), HasDocs api)
692+ => HasDocs (Capture sym a :> api) where
693693
694694 docsFor Proxy (endpoint, action) =
695− docsFor sublayoutP (endpoint', action')
695+ docsFor subApiP (endpoint', action')
696696
697− where sublayoutP = Proxy :: Proxy sublayout
697+ where subApiP = Proxy :: Proxy api
698698 captureP = Proxy :: Proxy (Capture sym a)
699699
700700 action' = over captures (|> toCapture captureP) action
@@ -736,43 +736,43 @@ instance OVERLAPPING_
736736 status = fromInteger $ natVal (Proxy :: Proxy status)
737737 p = Proxy :: Proxy a
738738
739−instance (KnownSymbol sym, HasDocs sublayout)
740− => HasDocs (Header sym a :> sublayout) where
739+instance (KnownSymbol sym, HasDocs api)
740+ => HasDocs (Header sym a :> api) where
741741 docsFor Proxy (endpoint, action) =
742− docsFor sublayoutP (endpoint, action')
742+ docsFor subApiP (endpoint, action')
743743
744− where sublayoutP = Proxy :: Proxy sublayout
744+ where subApiP = Proxy :: Proxy api
745745 action' = over headers (|> headername) action
746746 headername = T.pack $ symbolVal (Proxy :: Proxy sym)
747747
748−instance (KnownSymbol sym, ToParam (QueryParam sym a), HasDocs sublayout)
749− => HasDocs (QueryParam sym a :> sublayout) where
748+instance (KnownSymbol sym, ToParam (QueryParam sym a), HasDocs api)
749+ => HasDocs (QueryParam sym a :> api) where
750750
751751 docsFor Proxy (endpoint, action) =
752− docsFor sublayoutP (endpoint, action')
752+ docsFor subApiP (endpoint, action')
753753
754− where sublayoutP = Proxy :: Proxy sublayout
754+ where subApiP = Proxy :: Proxy api
755755 paramP = Proxy :: Proxy (QueryParam sym a)
756756 action' = over params (|> toParam paramP) action
757757
758−instance (KnownSymbol sym, ToParam (QueryParams sym a), HasDocs sublayout)
759− => HasDocs (QueryParams sym a :> sublayout) where
758+instance (KnownSymbol sym, ToParam (QueryParams sym a), HasDocs api)
759+ => HasDocs (QueryParams sym a :> api) where
760760
761761 docsFor Proxy (endpoint, action) =
762− docsFor sublayoutP (endpoint, action')
762+ docsFor subApiP (endpoint, action')
763763
764− where sublayoutP = Proxy :: Proxy sublayout
764+ where subApiP = Proxy :: Proxy api
765765 paramP = Proxy :: Proxy (QueryParams sym a)
766766 action' = over params (|> toParam paramP) action
767767
768768
769−instance (KnownSymbol sym, ToParam (QueryFlag sym), HasDocs sublayout)
770− => HasDocs (QueryFlag sym :> sublayout) where
769+instance (KnownSymbol sym, ToParam (QueryFlag sym), HasDocs api)
770+ => HasDocs (QueryFlag sym :> api) where
771771
772772 docsFor Proxy (endpoint, action) =
773− docsFor sublayoutP (endpoint, action')
773+ docsFor subApiP (endpoint, action')
774774
775− where sublayoutP = Proxy :: Proxy sublayout
775+ where subApiP = Proxy :: Proxy api
776776 paramP = Proxy :: Proxy (QueryFlag sym)
777777 action' = over params (|> toParam paramP) action
778778
@@ -785,49 +785,49 @@ instance HasDocs Raw where
785785-- example data. However, there's no reason to believe that the instances of
786786-- 'AllMimeUnrender' and 'AllMimeRender' actually agree (or to suppose that
787787-- both are even defined) for any particular type.
788−instance (ToSample a, AllMimeRender (ct ': cts) a, HasDocs sublayout)
789− => HasDocs (ReqBody (ct ': cts) a :> sublayout) where
788+instance (ToSample a, AllMimeRender (ct ': cts) a, HasDocs api)
789+ => HasDocs (ReqBody (ct ': cts) a :> api) where
790790
791791 docsFor Proxy (endpoint, action) =
792− docsFor sublayoutP (endpoint, action')
792+ docsFor subApiP (endpoint, action')
793793
794− where sublayoutP = Proxy :: Proxy sublayout
794+ where subApiP = Proxy :: Proxy api
795795 action' = action & rqbody .~ sampleByteString t p
796796 & rqtypes .~ allMime t
797797 t = Proxy :: Proxy (ct ': cts)
798798 p = Proxy :: Proxy a
799799
800−instance (KnownSymbol path, HasDocs sublayout) => HasDocs (path :> sublayout) where
800+instance (KnownSymbol path, HasDocs api) => HasDocs (path :> api) where
801801
802802 docsFor Proxy (endpoint, action) =
803− docsFor sublayoutP (endpoint', action)
803+ docsFor subApiP (endpoint', action)
804804
805− where sublayoutP = Proxy :: Proxy sublayout
805+ where subApiP = Proxy :: Proxy api
806806 endpoint' = endpoint & path <>~ [symbolVal pa]
807807 pa = Proxy :: Proxy path
808808
809−instance HasDocs sublayout => HasDocs (RemoteHost :> sublayout) where
809+instance HasDocs api => HasDocs (RemoteHost :> api) where
810810 docsFor Proxy ep =
811− docsFor (Proxy :: Proxy sublayout) ep
811+ docsFor (Proxy :: Proxy api) ep
812812
813−instance HasDocs sublayout => HasDocs (IsSecure :> sublayout) where
813+instance HasDocs api => HasDocs (IsSecure :> api) where
814814 docsFor Proxy ep =
815− docsFor (Proxy :: Proxy sublayout) ep
815+ docsFor (Proxy :: Proxy api) ep
816816
817−instance HasDocs sublayout => HasDocs (HttpVersion :> sublayout) where
817+instance HasDocs api => HasDocs (HttpVersion :> api) where
818818 docsFor Proxy ep =
819− docsFor (Proxy :: Proxy sublayout) ep
819+ docsFor (Proxy :: Proxy api) ep
820820
821−instance HasDocs sublayout => HasDocs (Vault :> sublayout) where
821+instance HasDocs api => HasDocs (Vault :> api) where
822822 docsFor Proxy ep =
823− docsFor (Proxy :: Proxy sublayout) ep
823+ docsFor (Proxy :: Proxy api) ep
824824
825−instance HasDocs sublayout => HasDocs (WithNamedContext name context sublayout) where
826− docsFor Proxy = docsFor (Proxy :: Proxy sublayout)
825+instance HasDocs api => HasDocs (WithNamedContext name context api) where
826+ docsFor Proxy = docsFor (Proxy :: Proxy api)
827827
828−instance (ToAuthInfo (BasicAuth realm usr), HasDocs sublayout) => HasDocs (BasicAuth realm usr :> sublayout) where
828+instance (ToAuthInfo (BasicAuth realm usr), HasDocs api) => HasDocs (BasicAuth realm usr :> api) where
829829 docsFor Proxy (endpoint, action) =
830− docsFor (Proxy :: Proxy sublayout) (endpoint, action')
830+ docsFor (Proxy :: Proxy api) (endpoint, action')
831831 where
832832 authProxy = Proxy :: Proxy (BasicAuth realm usr)
833833 action' = over authInfo (|> toAuthInfo authProxy) action