on master help sign in
Use ‘Int’ (just because everyone uses it)
commit59646713f5b1c2839679c2d08fe51b4eaef2b5c4 authormrkkrp <markkarpov@opmbx.org> dateFri 4 Nov 2016, 12:02 (10 years ago) parentd3afece
1 file changed+11−16
Network/HTTP/Req.hs+11−16
Network/HTTP/Req.hs+11−16
@@ -220,10 +220,6 @@ import qualified Network.HTTP.Req.AWS as AWS
220220import qualified Network.HTTP.Req.OAuth1 as OAuth1
221221import qualified Network.HTTP.Types as Y
222222
223−#if !MIN_VERSION_base(4,8,0)
224−import Data.Word (Word)
225−#endif
226−
227223----------------------------------------------------------------------------
228224-- Making a request
229225
@@ -331,7 +327,7 @@ data HttpConfig = HttpConfig
331327 -- ^ Proxy to use. By default values of @HTTP_PROXY@ and @HTTPS_PROXY@
332328 -- environment variables are respected, this setting overwrites them.
333329 -- Default value: 'Nothing'.
334− , httpConfigRedirectCount :: Word
330+ , httpConfigRedirectCount :: Int
335331 -- ^ How many redirects to follow when getting a resource. Default
336332 -- value: 10.
337333 , httpConfigAltManager :: Maybe L.Manager
@@ -363,7 +359,7 @@ instance Default HttpConfig where
363359instance RequestComponent HttpConfig where
364360 getRequestMod HttpConfig {..} = Endo $ \x ->
365361 x { L.proxy = httpConfigProxy
366− , L.redirectCount = fromIntegral httpConfigRedirectCount
362+ , L.redirectCount = httpConfigRedirectCount
367363 , LI.requestManagerOverride = httpConfigAltManager
368364 , LI.checkResponse = httpConfigCheckResponse }
369365
@@ -950,9 +946,9 @@ awsAuth accessKey secretKey = asFinalizer
950946-- determines default port, @80@ for HTTP and @443@ for HTTPS, this 'Option'
951947-- allows to choose arbitrary port overwriting the defaults.
952948
953−port :: Word -> Option scheme
949+port :: Int -> Option scheme
954950port n = withRequest $ \x ->
955− x { L.port = fromIntegral n }
951+ x { L.port = n }
956952
957953-- | This 'Option' controls whether gzipped data should be decompressed on
958954-- the fly. By default everything except for @application\/x-tar@ is
@@ -975,20 +971,19 @@ decompress f = withRequest $ \x ->
975971-- seconds.
976972
977973responseTimeout
978− :: Word -- ^ Number of microseconds to wait
974+ :: Int -- ^ Number of microseconds to wait
979975 -> Option scheme
980976responseTimeout n = withRequest $ \x ->
981− x { L.responseTimeout = LI.ResponseTimeoutMicro (fromIntegral n) }
977+ x { L.responseTimeout = LI.ResponseTimeoutMicro n }
982978
983979-- | HTTP version to send to server, default is HTTP 1.1.
984980
985981httpVersion
986− :: Word -- ^ Major version number
987− -> Word -- ^ Minor version number
982+ :: Int -- ^ Major version number
983+ -> Int -- ^ Minor version number
988984 -> Option scheme
989985httpVersion major minor = withRequest $ \x ->
990− x { L.requestVersion =
991− Y.HttpVersion (fromIntegral major) (fromIntegral minor) }
986+ x { L.requestVersion = Y.HttpVersion major minor }
992987
993988----------------------------------------------------------------------------
994989-- Response interpretations
@@ -1011,9 +1006,9 @@ responseBody = L.responseBody . toVanillaResponse
10111006responseStatusCode
10121007 :: HttpResponse response
10131008 => response
1014− -> Word
1009+ -> Int
10151010responseStatusCode =
1016− fromIntegral . Y.statusCode . L.responseStatus . toVanillaResponse
1011+ Y.statusCode . L.responseStatus . toVanillaResponse
10171012
10181013-- | Get response status message.
10191014