@@ -8,9 +8,8 @@
8{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE TypeFamilies #-}
9{-# LANGUAGE TypeOperators #-}
9{-# LANGUAGE TypeOperators #-}
10{-# LANGUAGE UndecidableInstances #-}
10{-# LANGUAGE UndecidableInstances #-}
11−#if !MIN_VERSION_base(4,8,0)
11+
12−{-# LANGUAGE OverlappingInstances #-}
12+#include "overlapping-compat.h"
14-- | This module provides 'client' which can automatically generate
13-- | This module provides 'client' which can automatically generate
15-- querying functions for each endpoint just from the type representing your
14-- querying functions for each endpoint just from the type representing your
@@ -123,19 +122,13 @@ instance (KnownSymbol capture, ToHttpApiData a, HasClient sublayout)
123-- side querying function that is created when calling 'client'
122-- side querying function that is created when calling 'client'
124-- will just require an argument that specifies the scheme, host
123-- will just require an argument that specifies the scheme, host
125-- and port to send the request to.
124-- and port to send the request to.
126−instance
125+instance OVERLAPPABLE_
127−#if MIN_VERSION_base(4,8,0)
128− {-# OVERLAPPABLE #-}
130 (MimeUnrender ct a, cts' ~ (ct ': cts)) => HasClient (Delete cts' a) where
126 (MimeUnrender ct a, cts' ~ (ct ': cts)) => HasClient (Delete cts' a) where
131 type Client (Delete cts' a) = ExceptT ServantError IO a
127 type Client (Delete cts' a) = ExceptT ServantError IO a
132 clientWithRoute Proxy req baseurl manager =
128 clientWithRoute Proxy req baseurl manager =
133 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodDelete req baseurl manager
129 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodDelete req baseurl manager
135−instance
131+instance OVERLAPPING_
136−#if MIN_VERSION_base(4,8,0)
139 HasClient (Delete cts ()) where
132 HasClient (Delete cts ()) where
140 type Client (Delete cts ()) = ExceptT ServantError IO ()
133 type Client (Delete cts ()) = ExceptT ServantError IO ()
141 clientWithRoute Proxy req baseurl manager =
134 clientWithRoute Proxy req baseurl manager =
@@ -143,10 +136,7 @@ instance
144-- | If you have a 'Delete xs (Headers ls x)' endpoint, the client expects the
137-- | If you have a 'Delete xs (Headers ls x)' endpoint, the client expects the
145-- corresponding headers.
138-- corresponding headers.
146−instance
139+instance OVERLAPPING_
147−#if MIN_VERSION_base(4,8,0)
150 ( MimeUnrender ct a, BuildHeadersTo ls, cts' ~ (ct ': cts)
140 ( MimeUnrender ct a, BuildHeadersTo ls, cts' ~ (ct ': cts)
151 ) => HasClient (Delete cts' (Headers ls a)) where
141 ) => HasClient (Delete cts' (Headers ls a)) where
152 type Client (Delete cts' (Headers ls a)) = ExceptT ServantError IO (Headers ls a)
142 type Client (Delete cts' (Headers ls a)) = ExceptT ServantError IO (Headers ls a)
@@ -160,19 +150,13 @@ instance
160-- side querying function that is created when calling 'client'
150-- side querying function that is created when calling 'client'
161-- will just require an argument that specifies the scheme, host
151-- will just require an argument that specifies the scheme, host
162-- and port to send the request to.
152-- and port to send the request to.
163−instance
153+instance OVERLAPPABLE_
164−#if MIN_VERSION_base(4,8,0)
165− {-# OVERLAPPABLE #-}
167 (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
154 (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
168 type Client (Get (ct ': cts) result) = ExceptT ServantError IO result
155 type Client (Get (ct ': cts) result) = ExceptT ServantError IO result
169 clientWithRoute Proxy req baseurl manager =
156 clientWithRoute Proxy req baseurl manager =
170 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodGet req baseurl manager
157 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodGet req baseurl manager
172−instance
159+instance OVERLAPPING_
173−#if MIN_VERSION_base(4,8,0)
176 HasClient (Get (ct ': cts) ()) where
160 HasClient (Get (ct ': cts) ()) where
177 type Client (Get (ct ': cts) ()) = ExceptT ServantError IO ()
161 type Client (Get (ct ': cts) ()) = ExceptT ServantError IO ()
178 clientWithRoute Proxy req baseurl manager =
162 clientWithRoute Proxy req baseurl manager =
@@ -180,10 +164,7 @@ instance
181-- | If you have a 'Get xs (Headers ls x)' endpoint, the client expects the
165-- | If you have a 'Get xs (Headers ls x)' endpoint, the client expects the
182-- corresponding headers.
166-- corresponding headers.
183−instance
167+instance OVERLAPPING_
184−#if MIN_VERSION_base(4,8,0)
187 ( MimeUnrender ct a, BuildHeadersTo ls
168 ( MimeUnrender ct a, BuildHeadersTo ls
188 ) => HasClient (Get (ct ': cts) (Headers ls a)) where
169 ) => HasClient (Get (ct ': cts) (Headers ls a)) where
189 type Client (Get (ct ': cts) (Headers ls a)) = ExceptT ServantError IO (Headers ls a)
170 type Client (Get (ct ': cts) (Headers ls a)) = ExceptT ServantError IO (Headers ls a)
@@ -240,19 +221,13 @@ instance (KnownSymbol sym, ToHttpApiData a, HasClient sublayout)
240-- side querying function that is created when calling 'client'
221-- side querying function that is created when calling 'client'
241-- will just require an argument that specifies the scheme, host
222-- will just require an argument that specifies the scheme, host
242-- and port to send the request to.
223-- and port to send the request to.
243−instance
224+instance OVERLAPPABLE_
244−#if MIN_VERSION_base(4,8,0)
245− {-# OVERLAPPABLE #-}
247 (MimeUnrender ct a) => HasClient (Post (ct ': cts) a) where
225 (MimeUnrender ct a) => HasClient (Post (ct ': cts) a) where
248 type Client (Post (ct ': cts) a) = ExceptT ServantError IO a
226 type Client (Post (ct ': cts) a) = ExceptT ServantError IO a
249 clientWithRoute Proxy req baseurl manager =
227 clientWithRoute Proxy req baseurl manager =
250 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPost req baseurl manager
228 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPost req baseurl manager
252−instance
230+instance OVERLAPPING_
253−#if MIN_VERSION_base(4,8,0)
256 HasClient (Post (ct ': cts) ()) where
231 HasClient (Post (ct ': cts) ()) where
257 type Client (Post (ct ': cts) ()) = ExceptT ServantError IO ()
232 type Client (Post (ct ': cts) ()) = ExceptT ServantError IO ()
258 clientWithRoute Proxy req baseurl manager =
233 clientWithRoute Proxy req baseurl manager =
@@ -260,10 +235,7 @@ instance
261-- | If you have a 'Post xs (Headers ls x)' endpoint, the client expects the
236-- | If you have a 'Post xs (Headers ls x)' endpoint, the client expects the
262-- corresponding headers.
237-- corresponding headers.
263−instance
238+instance OVERLAPPING_
264−#if MIN_VERSION_base(4,8,0)
267 ( MimeUnrender ct a, BuildHeadersTo ls
239 ( MimeUnrender ct a, BuildHeadersTo ls
268 ) => HasClient (Post (ct ': cts) (Headers ls a)) where
240 ) => HasClient (Post (ct ': cts) (Headers ls a)) where
269 type Client (Post (ct ': cts) (Headers ls a)) = ExceptT ServantError IO (Headers ls a)
241 type Client (Post (ct ': cts) (Headers ls a)) = ExceptT ServantError IO (Headers ls a)
@@ -277,19 +249,13 @@ instance
277-- side querying function that is created when calling 'client'
249-- side querying function that is created when calling 'client'
278-- will just require an argument that specifies the scheme, host
250-- will just require an argument that specifies the scheme, host
279-- and port to send the request to.
251-- and port to send the request to.
280−instance
252+instance OVERLAPPABLE_
281−#if MIN_VERSION_base(4,8,0)
282− {-# OVERLAPPABLE #-}
284 (MimeUnrender ct a) => HasClient (Put (ct ': cts) a) where
253 (MimeUnrender ct a) => HasClient (Put (ct ': cts) a) where
285 type Client (Put (ct ': cts) a) = ExceptT ServantError IO a
254 type Client (Put (ct ': cts) a) = ExceptT ServantError IO a
286 clientWithRoute Proxy req baseurl manager =
255 clientWithRoute Proxy req baseurl manager =
287 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPut req baseurl manager
256 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPut req baseurl manager
289−instance
258+instance OVERLAPPING_
290−#if MIN_VERSION_base(4,8,0)
293 HasClient (Put (ct ': cts) ()) where
259 HasClient (Put (ct ': cts) ()) where
294 type Client (Put (ct ': cts) ()) = ExceptT ServantError IO ()
260 type Client (Put (ct ': cts) ()) = ExceptT ServantError IO ()
295 clientWithRoute Proxy req baseurl manager =
261 clientWithRoute Proxy req baseurl manager =
@@ -297,10 +263,7 @@ instance
298-- | If you have a 'Put xs (Headers ls x)' endpoint, the client expects the
264-- | If you have a 'Put xs (Headers ls x)' endpoint, the client expects the
299-- corresponding headers.
265-- corresponding headers.
300−instance
266+instance OVERLAPPING_
301−#if MIN_VERSION_base(4,8,0)
304 ( MimeUnrender ct a, BuildHeadersTo ls
267 ( MimeUnrender ct a, BuildHeadersTo ls
305 ) => HasClient (Put (ct ': cts) (Headers ls a)) where
268 ) => HasClient (Put (ct ': cts) (Headers ls a)) where
306 type Client (Put (ct ': cts) (Headers ls a)) = ExceptT ServantError IO (Headers ls a)
269 type Client (Put (ct ': cts) (Headers ls a)) = ExceptT ServantError IO (Headers ls a)
@@ -314,19 +277,13 @@ instance
314-- side querying function that is created when calling 'client'
277-- side querying function that is created when calling 'client'
315-- will just require an argument that specifies the scheme, host
278-- will just require an argument that specifies the scheme, host
316-- and port to send the request to.
279-- and port to send the request to.
317−instance
280+instance OVERLAPPABLE_
318−#if MIN_VERSION_base(4,8,0)
319− {-# OVERLAPPABLE #-}
321 (MimeUnrender ct a) => HasClient (Patch (ct ': cts) a) where
281 (MimeUnrender ct a) => HasClient (Patch (ct ': cts) a) where
322 type Client (Patch (ct ': cts) a) = ExceptT ServantError IO a
282 type Client (Patch (ct ': cts) a) = ExceptT ServantError IO a
323 clientWithRoute Proxy req baseurl manager =
283 clientWithRoute Proxy req baseurl manager =
324 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPatch req baseurl manager
284 snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPatch req baseurl manager
326−instance
286+instance OVERLAPPING_
327−#if MIN_VERSION_base(4,8,0)
330 HasClient (Patch (ct ': cts) ()) where
287 HasClient (Patch (ct ': cts) ()) where
331 type Client (Patch (ct ': cts) ()) = ExceptT ServantError IO ()
288 type Client (Patch (ct ': cts) ()) = ExceptT ServantError IO ()
332 clientWithRoute Proxy req baseurl manager =
289 clientWithRoute Proxy req baseurl manager =
@@ -334,10 +291,7 @@ instance
335-- | If you have a 'Patch xs (Headers ls x)' endpoint, the client expects the
292-- | If you have a 'Patch xs (Headers ls x)' endpoint, the client expects the
336-- corresponding headers.
293-- corresponding headers.
337−instance
294+instance OVERLAPPING_
338−#if MIN_VERSION_base(4,8,0)
341 ( MimeUnrender ct a, BuildHeadersTo ls
295 ( MimeUnrender ct a, BuildHeadersTo ls
342 ) => HasClient (Patch (ct ': cts) (Headers ls a)) where
296 ) => HasClient (Patch (ct ': cts) (Headers ls a)) where
343 type Client (Patch (ct ': cts) (Headers ls a)) = ExceptT ServantError IO (Headers ls a)
297 type Client (Patch (ct ': cts) (Headers ls a)) = ExceptT ServantError IO (Headers ls a)