cleanup compiler's warnings
This commit is contained in:
parent
2dcc92bd9a
commit
d933ef281e
2 changed files with 6 additions and 7 deletions
|
@ -108,7 +108,7 @@ data EmptyClient = EmptyClient deriving (Eq, Show, Bounded, Enum)
|
||||||
-- > (getAllBooks :<|> EmptyClient) = client myApi
|
-- > (getAllBooks :<|> EmptyClient) = client myApi
|
||||||
instance HasClient m EmptyAPI where
|
instance HasClient m EmptyAPI where
|
||||||
type Client m EmptyAPI = EmptyClient
|
type Client m EmptyAPI = EmptyClient
|
||||||
clientWithRoute pm Proxy _ = EmptyClient
|
clientWithRoute _pm Proxy _ = EmptyClient
|
||||||
|
|
||||||
-- | If you use a 'Capture' in one of your endpoints in your API,
|
-- | If you use a 'Capture' in one of your endpoints in your API,
|
||||||
-- the corresponding querying function will automatically take
|
-- the corresponding querying function will automatically take
|
||||||
|
@ -178,7 +178,7 @@ instance OVERLAPPABLE_
|
||||||
(RunClient m ct ([H.Header], a), MimeUnrender ct a, ReflectMethod method, cts' ~ (ct ': cts)
|
(RunClient m ct ([H.Header], a), MimeUnrender ct a, ReflectMethod method, cts' ~ (ct ': cts)
|
||||||
) => HasClient m (Verb method status cts' a) where
|
) => HasClient m (Verb method status cts' a) where
|
||||||
type Client m (Verb method status cts' a) = m a
|
type Client m (Verb method status cts' a) = m a
|
||||||
clientWithRoute pm Proxy req = do
|
clientWithRoute _pm Proxy req = do
|
||||||
(_hdrs, a) :: ([H.Header], a) <- runRequest (Proxy :: Proxy ct) method req
|
(_hdrs, a) :: ([H.Header], a) <- runRequest (Proxy :: Proxy ct) method req
|
||||||
return a
|
return a
|
||||||
where method = reflectMethod (Proxy :: Proxy method)
|
where method = reflectMethod (Proxy :: Proxy method)
|
||||||
|
@ -188,7 +188,7 @@ instance OVERLAPPING_
|
||||||
, ReflectMethod method) => HasClient m (Verb method status cts NoContent) where
|
, ReflectMethod method) => HasClient m (Verb method status cts NoContent) where
|
||||||
type Client m (Verb method status cts NoContent)
|
type Client m (Verb method status cts NoContent)
|
||||||
= m NoContent
|
= m NoContent
|
||||||
clientWithRoute pm Proxy req = do
|
clientWithRoute _pm Proxy req = do
|
||||||
_hdrs :: [H.Header] <- runRequest (Proxy :: Proxy NoContent) method req
|
_hdrs :: [H.Header] <- runRequest (Proxy :: Proxy NoContent) method req
|
||||||
return NoContent
|
return NoContent
|
||||||
where method = reflectMethod (Proxy :: Proxy method)
|
where method = reflectMethod (Proxy :: Proxy method)
|
||||||
|
@ -200,7 +200,7 @@ instance OVERLAPPING_
|
||||||
) => HasClient m (Verb method status cts' (Headers ls a)) where
|
) => HasClient m (Verb method status cts' (Headers ls a)) where
|
||||||
type Client m (Verb method status cts' (Headers ls a))
|
type Client m (Verb method status cts' (Headers ls a))
|
||||||
= m (Headers ls a)
|
= m (Headers ls a)
|
||||||
clientWithRoute pm Proxy req = do
|
clientWithRoute _pm Proxy req = do
|
||||||
let method = reflectMethod (Proxy :: Proxy method)
|
let method = reflectMethod (Proxy :: Proxy method)
|
||||||
(hdrs, resp) <- runRequest (Proxy :: Proxy ct) method req
|
(hdrs, resp) <- runRequest (Proxy :: Proxy ct) method req
|
||||||
return $ Headers { getResponse = resp
|
return $ Headers { getResponse = resp
|
||||||
|
@ -213,7 +213,7 @@ instance OVERLAPPING_
|
||||||
) => HasClient m (Verb method status cts (Headers ls NoContent)) where
|
) => HasClient m (Verb method status cts (Headers ls NoContent)) where
|
||||||
type Client m (Verb method status cts (Headers ls NoContent))
|
type Client m (Verb method status cts (Headers ls NoContent))
|
||||||
= m (Headers ls NoContent)
|
= m (Headers ls NoContent)
|
||||||
clientWithRoute pm Proxy req = do
|
clientWithRoute _pm Proxy req = do
|
||||||
let method = reflectMethod (Proxy :: Proxy method)
|
let method = reflectMethod (Proxy :: Proxy method)
|
||||||
hdrs <- runRequest (Proxy :: Proxy NoContent) method req
|
hdrs <- runRequest (Proxy :: Proxy NoContent) method req
|
||||||
return $ Headers { getResponse = NoContent
|
return $ Headers { getResponse = NoContent
|
||||||
|
@ -416,7 +416,7 @@ instance (RunClient m NoContent (Int, ByteString, MediaType, [HTTP.Header], Resp
|
||||||
= H.Method -> m (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
|
= H.Method -> m (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
|
||||||
|
|
||||||
clientWithRoute :: Proxy m -> Proxy Raw -> Req -> Client m Raw
|
clientWithRoute :: Proxy m -> Proxy Raw -> Req -> Client m Raw
|
||||||
clientWithRoute pm Proxy req httpMethod = do
|
clientWithRoute _pm Proxy req httpMethod = do
|
||||||
runRequest (Proxy :: Proxy NoContent) httpMethod req
|
runRequest (Proxy :: Proxy NoContent) httpMethod req
|
||||||
|
|
||||||
-- | If you use a 'ReqBody' in one of your endpoints in your API,
|
-- | If you use a 'ReqBody' in one of your endpoints in your API,
|
||||||
|
|
|
@ -6,7 +6,6 @@ where
|
||||||
|
|
||||||
import Data.Proxy
|
import Data.Proxy
|
||||||
import Network.HTTP.Types
|
import Network.HTTP.Types
|
||||||
import Servant.API
|
|
||||||
import Servant.Common.Req
|
import Servant.Common.Req
|
||||||
|
|
||||||
class (Monad m) => RunClient m ct result where
|
class (Monad m) => RunClient m ct result where
|
||||||
|
|
Loading…
Reference in a new issue