git.iko.soy/typeable/servant
on master help sign in
make BaseUrl an argument to 'client' instead of each function produced by 'client'

Headers for all Remove Canonicalize

commit8f100a14e8037aecdbb7d8497971d53491f3f06b authorAlp Mestanogullari <alpmestan@gmail.com> dateFri 24 Apr 2015, 17:51 (11 years ago) parent95abfc4
4 files changed+142−88
servant-client/src/Servant/Client.hs+116−87 servant-docs/example/greet.hs+1 servant-docs/src/Servant/Docs/Internal.hs+25−1 servant/Setup
servant-client/src/Servant/Client.hs+116−87
@@ -36,6 +36,8 @@ import Network.HTTP.Media
3636import qualified Network.HTTP.Types as H
3737import qualified Network.HTTP.Types.Header as HTTP
3838import Servant.API
39+import Servant.API.ResponseHeaders
40+import Servant.API.ContentTypes
3941import Servant.Common.BaseUrl
4042import Servant.Common.Req
4143
@@ -62,6 +64,7 @@ class HasClient layout where
6264 type Client layout :: *
6365 clientWithRoute :: Proxy layout -> Req -> Client layout
6466
67+type Client layout = Client' layout
6568
6669-- | A client querying function for @a ':<|>' b@ will actually hand you
6770-- one function for querying @a@ and another one for querying @b@,
@@ -107,9 +110,10 @@ instance (KnownSymbol capture, ToText a, HasClient sublayout)
107110 type Client (Capture capture a :> sublayout) =
108111 a -> Client sublayout
109112
110− clientWithRoute Proxy req val =
111− clientWithRoute (Proxy :: Proxy sublayout) $
112− appendToPath p req
113+ clientWithRoute Proxy req baseurl val =
114+ clientWithRoute (Proxy :: Proxy sublayout)
115+ (appendToPath p req)
116+ baseurl
113117
114118 where p = unpack (toText val)
115119
@@ -122,9 +126,9 @@ instance
122126 {-# OVERLAPPABLE #-}
123127#endif
124128 (MimeUnrender ct a) => HasClient (Delete (ct ': cts) a) where
125− type Client (Delete (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
126− clientWithRoute Proxy req host =
127− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodDelete req [200, 202] host
129+ type Client (Delete (ct ': cts) a) = EitherT ServantError IO a
130+ clientWithRoute Proxy req baseurl =
131+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodDelete req [200, 202] baseurl
128132
129133-- | If you have a 'Delete xs ()' endpoint, the client expects a 204 No Content
130134-- HTTP header.
@@ -133,9 +137,9 @@ instance
133137 {-# OVERLAPPING #-}
134138#endif
135139 HasClient (Delete (ct ': cts) ()) where
136− type Client (Delete (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
137− clientWithRoute Proxy req host =
138− void $ performRequestNoBody H.methodDelete req [204] host
140+ type Client (Delete (ct ': cts) ()) = EitherT ServantError IO ()
141+ clientWithRoute Proxy req baseurl =
142+ void $ performRequestNoBody H.methodDelete req [204] baseurl
139143
140144-- | If you have a 'Delete xs (Headers ls x)' endpoint, the client expects the
141145-- corresponding headers.
@@ -145,14 +149,13 @@ instance
145149#endif
146150 ( MimeUnrender ct a, BuildHeadersTo ls
147151 ) => HasClient (Delete (ct ': cts) (Headers ls a)) where
148− type Client (Delete (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
149− clientWithRoute Proxy req host = do
150− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodDelete req [200, 202] host
152+ type Client (Delete (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
153+ clientWithRoute Proxy req baseurl = do
154+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodDelete req [200, 202] baseurl
151155 return $ Headers { getResponse = resp
152156 , getHeadersHList = buildHeadersTo hdrs
153157 }
154158
155−
156159-- | If you have a 'Get' endpoint in your API, the client
157160-- side querying function that is created when calling 'client'
158161-- will just require an argument that specifies the scheme, host
@@ -162,9 +165,9 @@ instance
162165 {-# OVERLAPPABLE #-}
163166#endif
164167 (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
165− type Client (Get (ct ': cts) result) = BaseUrl -> EitherT ServantError IO result
166− clientWithRoute Proxy req host =
167− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203] host
168+ type Client (Get (ct ': cts) result) = EitherT ServantError IO result
169+ clientWithRoute Proxy req baseurl =
170+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203] baseurl
168171
169172-- | If you have a 'Get xs ()' endpoint, the client expects a 204 No Content
170173-- HTTP status.
@@ -173,9 +176,9 @@ instance
173176 {-# OVERLAPPING #-}
174177#endif
175178 HasClient (Get (ct ': cts) ()) where
176− type Client (Get (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
177− clientWithRoute Proxy req host =
178− performRequestNoBody H.methodGet req [204] host
179+ type Client (Get (ct ': cts) ()) = EitherT ServantError IO ()
180+ clientWithRoute Proxy req baseurl =
181+ performRequestNoBody H.methodGet req [204] baseurl
179182
180183-- | If you have a 'Get xs (Headers ls x)' endpoint, the client expects the
181184-- corresponding headers.
@@ -185,9 +188,9 @@ instance
185188#endif
186189 ( MimeUnrender ct a, BuildHeadersTo ls
187190 ) => HasClient (Get (ct ': cts) (Headers ls a)) where
188− type Client (Get (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
189− clientWithRoute Proxy req host = do
190− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203, 204] host
191+ type Client (Get (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
192+ clientWithRoute Proxy req baseurl = do
193+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203, 204] baseurl
191194 return $ Headers { getResponse = resp
192195 , getHeadersHList = buildHeadersTo hdrs
193196 }
@@ -223,9 +226,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
223226 type Client (Header sym a :> sublayout) =
224227 Maybe a -> Client sublayout
225228
226− clientWithRoute Proxy req mval =
227− clientWithRoute (Proxy :: Proxy sublayout) $
228− maybe req (\value -> Servant.Common.Req.addHeader hname value req) mval
229+ clientWithRoute Proxy req baseurl mval =
230+ clientWithRoute (Proxy :: Proxy sublayout)
231+ (maybe req
232+ (\value -> Servant.Common.Req.addHeader hname value req)
233+ mval
234+ )
235+ baseurl
229236
230237 where hname = symbolVal (Proxy :: Proxy sym)
231238
@@ -238,10 +245,9 @@ instance
238245 {-# OVERLAPPABLE #-}
239246#endif
240247 (MimeUnrender ct a) => HasClient (Post (ct ': cts) a) where
241− type Client (Post (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
242−
243− clientWithRoute Proxy req uri =
244− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPost req [200,201] uri
248+ type Client (Post (ct ': cts) a) = EitherT ServantError IO a
249+ clientWithRoute Proxy req baseurl =
250+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPost req [200,201] baseurl
245251
246252-- | If you have a 'Post xs ()' endpoint, the client expects a 204 No Content
247253-- HTTP header.
@@ -250,9 +256,9 @@ instance
250256 {-# OVERLAPPING #-}
251257#endif
252258 HasClient (Post (ct ': cts) ()) where
253− type Client (Post (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
254− clientWithRoute Proxy req host =
255− void $ performRequestNoBody H.methodPost req [204] host
259+ type Client (Post (ct ': cts) ()) = EitherT ServantError IO ()
260+ clientWithRoute Proxy req baseurl =
261+ void $ performRequestNoBody H.methodPost req [204] baseurl
256262
257263-- | If you have a 'Post xs (Headers ls x)' endpoint, the client expects the
258264-- corresponding headers.
@@ -262,9 +268,9 @@ instance
262268#endif
263269 ( MimeUnrender ct a, BuildHeadersTo ls
264270 ) => HasClient (Post (ct ': cts) (Headers ls a)) where
265− type Client (Post (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
266− clientWithRoute Proxy req host = do
267− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPost req [200, 201] host
271+ type Client (Post (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
272+ clientWithRoute Proxy req baseurl = do
273+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPost req [200, 201] baseurl
268274 return $ Headers { getResponse = resp
269275 , getHeadersHList = buildHeadersTo hdrs
270276 }
@@ -278,10 +284,9 @@ instance
278284 {-# OVERLAPPABLE #-}
279285#endif
280286 (MimeUnrender ct a) => HasClient (Put (ct ': cts) a) where
281− type Client (Put (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
282−
283− clientWithRoute Proxy req host =
284− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPut req [200,201] host
287+ type Client (Put (ct ': cts) a) = EitherT ServantError IO a
288+ clientWithRoute Proxy req baseurl =
289+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPut req [200,201] baseurl
285290
286291-- | If you have a 'Put xs ()' endpoint, the client expects a 204 No Content
287292-- HTTP header.
@@ -290,9 +295,9 @@ instance
290295 {-# OVERLAPPING #-}
291296#endif
292297 HasClient (Put (ct ': cts) ()) where
293− type Client (Put (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
294− clientWithRoute Proxy req host =
295− void $ performRequestNoBody H.methodPut req [204] host
298+ type Client (Put (ct ': cts) ()) = EitherT ServantError IO ()
299+ clientWithRoute Proxy req baseurl =
300+ void $ performRequestNoBody H.methodPut req [204] baseurl
296301
297302-- | If you have a 'Put xs (Headers ls x)' endpoint, the client expects the
298303-- corresponding headers.
@@ -302,9 +307,9 @@ instance
302307#endif
303308 ( MimeUnrender ct a, BuildHeadersTo ls
304309 ) => HasClient (Put (ct ': cts) (Headers ls a)) where
305− type Client (Put (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
306− clientWithRoute Proxy req host = do
307− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPut req [200, 201] host
310+ type Client (Put (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
311+ clientWithRoute Proxy req baseurl = do
312+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPut req [200, 201] baseurl
308313 return $ Headers { getResponse = resp
309314 , getHeadersHList = buildHeadersTo hdrs
310315 }
@@ -318,10 +323,9 @@ instance
318323 {-# OVERLAPPABLE #-}
319324#endif
320325 (MimeUnrender ct a) => HasClient (Patch (ct ': cts) a) where
321− type Client (Patch (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
322−
323− clientWithRoute Proxy req host =
324− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200,201] host
326+ type Client (Patch (ct ': cts) a) = EitherT ServantError IO a
327+ clientWithRoute Proxy req baseurl =
328+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200,201] baseurl
325329
326330-- | If you have a 'Patch xs ()' endpoint, the client expects a 204 No Content
327331-- HTTP header.
@@ -330,9 +334,9 @@ instance
330334 {-# OVERLAPPING #-}
331335#endif
332336 HasClient (Patch (ct ': cts) ()) where
333− type Client (Patch (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
334− clientWithRoute Proxy req host =
335− void $ performRequestNoBody H.methodPatch req [204] host
337+ type Client (Patch (ct ': cts) ()) = EitherT ServantError IO ()
338+ clientWithRoute Proxy req baseurl =
339+ void $ performRequestNoBody H.methodPatch req [204] baseurl
336340
337341-- | If you have a 'Patch xs (Headers ls x)' endpoint, the client expects the
338342-- corresponding headers.
@@ -342,9 +346,9 @@ instance
342346#endif
343347 ( MimeUnrender ct a, BuildHeadersTo ls
344348 ) => HasClient (Patch (ct ': cts) (Headers ls a)) where
345− type Client (Patch (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
346− clientWithRoute Proxy req host = do
347− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200, 201, 204] host
349+ type Client (Patch (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
350+ clientWithRoute Proxy req baseurl = do
351+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200, 201, 204] baseurl
348352 return $ Headers { getResponse = resp
349353 , getHeadersHList = buildHeadersTo hdrs
350354 }
@@ -381,9 +385,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
381385 Maybe a -> Client sublayout
382386
383387 -- if mparam = Nothing, we don't add it to the query string
384− clientWithRoute Proxy req mparam =
385− clientWithRoute (Proxy :: Proxy sublayout) $
386− maybe req (flip (appendToQueryString pname) req . Just) mparamText
388+ clientWithRoute Proxy req baseurl mparam =
389+ clientWithRoute (Proxy :: Proxy sublayout)
390+ (maybe req
391+ (flip (appendToQueryString pname) req . Just)
392+ mparamText
393+ )
394+ baseurl
387395
388396 where pname = cs pname'
389397 pname' = symbolVal (Proxy :: Proxy sym)
@@ -422,9 +430,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
422430 type Client (QueryParams sym a :> sublayout) =
423431 [a] -> Client sublayout
424432
425− clientWithRoute Proxy req paramlist =
426− clientWithRoute (Proxy :: Proxy sublayout) $
427− foldl' (\ req' -> maybe req' (flip (appendToQueryString pname) req' . Just)) req paramlist'
433+ clientWithRoute Proxy req baseurl paramlist =
434+ clientWithRoute (Proxy :: Proxy sublayout)
435+ (foldl' (\ req' -> maybe req' (flip (appendToQueryString pname) req' . Just))
436+ req
437+ paramlist'
438+ )
439+ baseurl
428440
429441 where pname = cs pname'
430442 pname' = symbolVal (Proxy :: Proxy sym)
@@ -457,11 +469,13 @@ instance (KnownSymbol sym, HasClient sublayout)
457469 type Client (QueryFlag sym :> sublayout) =
458470 Bool -> Client sublayout
459471
460− clientWithRoute Proxy req flag =
461− clientWithRoute (Proxy :: Proxy sublayout) $
462− if flag
463− then appendToQueryString paramname Nothing req
464− else req
472+ clientWithRoute Proxy req baseurl flag =
473+ clientWithRoute (Proxy :: Proxy sublayout)
474+ (if flag
475+ then appendToQueryString paramname Nothing req
476+ else req
477+ )
478+ baseurl
465479
466480 where paramname = cs $ symbolVal (Proxy :: Proxy sym)
467481
@@ -497,9 +511,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
497511 Maybe a -> Client sublayout
498512
499513 -- if mparam = Nothing, we don't add it to the query string
500− clientWithRoute Proxy req mparam =
501− clientWithRoute (Proxy :: Proxy sublayout) $
502− maybe req (flip (appendToMatrixParams pname . Just) req) mparamText
514+ clientWithRoute Proxy req baseurl mparam =
515+ clientWithRoute (Proxy :: Proxy sublayout)
516+ (maybe req
517+ (flip (appendToMatrixParams pname . Just) req)
518+ mparamText
519+ )
520+ baseurl
503521
504522 where pname = symbolVal (Proxy :: Proxy sym)
505523 mparamText = fmap (cs . toText) mparam
@@ -537,9 +555,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
537555 type Client (MatrixParams sym a :> sublayout) =
538556 [a] -> Client sublayout
539557
540− clientWithRoute Proxy req paramlist =
541− clientWithRoute (Proxy :: Proxy sublayout) $
542− foldl' (\ req' value -> maybe req' (flip (appendToMatrixParams pname) req' . Just . cs) value) req paramlist'
558+ clientWithRoute Proxy req baseurl paramlist =
559+ clientWithRoute (Proxy :: Proxy sublayout)
560+ (foldl' (\ req' value -> maybe req' (flip (appendToMatrixParams pname) req' . Just . cs) value)
561+ req
562+ paramlist'
563+ )
564+ baseurl
543565
544566 where pname = cs pname'
545567 pname' = symbolVal (Proxy :: Proxy sym)
@@ -572,22 +594,24 @@ instance (KnownSymbol sym, HasClient sublayout)
572594 type Client (MatrixFlag sym :> sublayout) =
573595 Bool -> Client sublayout
574596
575− clientWithRoute Proxy req flag =
576− clientWithRoute (Proxy :: Proxy sublayout) $
577− if flag
578− then appendToMatrixParams paramname Nothing req
579− else req
597+ clientWithRoute Proxy req baseurl flag =
598+ clientWithRoute (Proxy :: Proxy sublayout)
599+ (if flag
600+ then appendToMatrixParams paramname Nothing req
601+ else req
602+ )
603+ baseurl
580604
581605 where paramname = cs $ symbolVal (Proxy :: Proxy sym)
582606
583607-- | Pick a 'Method' and specify where the server you want to query is. You get
584608-- back the full `Response`.
585609instance HasClient Raw where
586− type Client Raw = H.Method -> BaseUrl -> EitherT ServantError IO (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
610+ type Client Raw = H.Method -> EitherT ServantError IO (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
587611
588612 clientWithRoute :: Proxy Raw -> Req -> Client Raw
589− clientWithRoute Proxy req httpMethod host = do
590− performRequest httpMethod req (const True) host
613+ clientWithRoute Proxy req httpMethod baseurl = do
614+ performRequest httpMethod req (const True) baseurl
591615
592616-- | If you use a 'ReqBody' in one of your endpoints in your API,
593617-- the corresponding querying function will automatically take
@@ -613,18 +637,23 @@ instance (MimeRender ct a, HasClient sublayout)
613637 type Client (ReqBody (ct ': cts) a :> sublayout) =
614638 a -> Client sublayout
615639
616− clientWithRoute Proxy req body =
617− clientWithRoute (Proxy :: Proxy sublayout) $ do
618− let ctProxy = Proxy :: Proxy ct
619− setRQBody (mimeRender ctProxy body) (contentType ctProxy) req
640+ clientWithRoute Proxy req baseurl body =
641+ clientWithRoute (Proxy :: Proxy sublayout)
642+ (let ctProxy = Proxy :: Proxy ct
643+ in setRQBody (mimeRender ctProxy body)
644+ (contentType ctProxy)
645+ req
646+ )
647+ baseurl
620648
621649-- | Make the querying function append @path@ to the request path.
622650instance (KnownSymbol path, HasClient sublayout) => HasClient (path :> sublayout) where
623651 type Client (path :> sublayout) = Client sublayout
624652
625− clientWithRoute Proxy req =
626− clientWithRoute (Proxy :: Proxy sublayout) $
627− appendToPath p req
653+ clientWithRoute Proxy req baseurl =
654+ clientWithRoute (Proxy :: Proxy sublayout)
655+ (appendToPath p req)
656+ baseurl
628657
629658 where p = symbolVal (Proxy :: Proxy path)
630659
servant-docs/example/greet.hs+1
@@ -8,6 +8,7 @@
88import Control.Lens
99import Data.Aeson
1010import Data.Proxy
11+import Data.ByteString.Conversion
1112import Data.String.Conversions
1213import Data.Text (Text)
1314import GHC.Generics
servant-docs/src/Servant/Docs/Internal.hs+25−1
@@ -40,6 +40,7 @@ import GHC.Generics
4040import GHC.TypeLits
4141import Servant.API
4242import Servant.API.ContentTypes
43+import Servant.API.ResponseHeaders
4344import Servant.Utils.Links
4445
4546import qualified Data.HashMap.Strict as HM
@@ -395,7 +396,6 @@ instance ToSample a b => ToSample (Headers ls a) b where
395396 toSample _ = toSample (Proxy :: Proxy a)
396397 toSamples _ = toSamples (Proxy :: Proxy a)
397398
398−
399399class AllHeaderSamples ls where
400400 allHeaderToSample :: Proxy ls -> [HTTP.Header]
401401
@@ -684,11 +684,15 @@ instance
684684 t = Proxy :: Proxy cts
685685 p = Proxy :: Proxy a
686686
687+<<<<<<< HEAD
687688instance
688689#if MIN_VERSION_base(4,8,0)
689690 {-# OVERLAPPABLe #-}
690691#endif
691692 (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts)
693+=======
694+instance (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts)
695+>>>>>>> Headers for all
692696 => HasDocs (Get cts a) where
693697 docsFor Proxy (endpoint, action) =
694698 single endpoint' action'
@@ -699,11 +703,15 @@ instance
699703 t = Proxy :: Proxy cts
700704 p = Proxy :: Proxy a
701705
706+<<<<<<< HEAD
702707instance
703708#if MIN_VERSION_base(4,8,0)
704709 {-# OVERLAPPING #-}
705710#endif
706711 (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts
712+=======
713+instance (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts
714+>>>>>>> Headers for all
707715 , AllHeaderSamples ls , GetHeaders (HList ls) )
708716 => HasDocs (Get cts (Headers ls a)) where
709717 docsFor Proxy (endpoint, action) =
@@ -726,11 +734,15 @@ instance (KnownSymbol sym, HasDocs sublayout)
726734 action' = over headers (|> headername) action
727735 headername = pack $ symbolVal (Proxy :: Proxy sym)
728736
737+<<<<<<< HEAD
729738instance
730739#if MIN_VERSION_base(4,8,0)
731740 {-# OVERLAPPABLE #-}
732741#endif
733742 (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts)
743+=======
744+instance (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts)
745+>>>>>>> Headers for all
734746 => HasDocs (Post cts a) where
735747 docsFor Proxy (endpoint, action) =
736748 single endpoint' action'
@@ -742,11 +754,15 @@ instance
742754 t = Proxy :: Proxy cts
743755 p = Proxy :: Proxy a
744756
757+<<<<<<< HEAD
745758instance
746759#if MIN_VERSION_base(4,8,0)
747760 {-# OVERLAPPING #-}
748761#endif
749762 (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts
763+=======
764+instance (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts
765+>>>>>>> Headers for all
750766 , AllHeaderSamples ls , GetHeaders (HList ls) )
751767 => HasDocs (Post cts (Headers ls a)) where
752768 docsFor Proxy (endpoint, action) =
@@ -761,11 +777,15 @@ instance
761777 t = Proxy :: Proxy cts
762778 p = Proxy :: Proxy a
763779
780+<<<<<<< HEAD
764781instance
765782#if MIN_VERSION_base(4,8,0)
766783 {-# OVERLAPPABLE #-}
767784#endif
768785 (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts)
786+=======
787+instance (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts)
788+>>>>>>> Headers for all
769789 => HasDocs (Put cts a) where
770790 docsFor Proxy (endpoint, action) =
771791 single endpoint' action'
@@ -777,11 +797,15 @@ instance
777797 t = Proxy :: Proxy cts
778798 p = Proxy :: Proxy a
779799
800+<<<<<<< HEAD
780801instance
781802#if MIN_VERSION_base(4,8,0)
782803 {-# OVERLAPPING #-}
783804#endif
784805 (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts
806+=======
807+instance (ToSample a b, IsNonEmpty cts, AllMimeRender cts b, SupportedTypes cts
808+>>>>>>> Headers for all
785809 , AllHeaderSamples ls , GetHeaders (HList ls) )
786810 => HasDocs (Put cts (Headers ls a)) where
787811 docsFor Proxy (endpoint, action) =
servant/Setupnew file

Binary file not shown.