simplify type to IO

This commit is contained in:
Michael Xavier 2015-12-03 15:47:24 -08:00
parent b8116737a0
commit 8801a3e580
2 changed files with 4 additions and 5 deletions

View File

@ -176,9 +176,9 @@ dispatch dMethod url body = do
initReq <- liftIO $ parseUrl' url
reqHook <- bhRequestHook <$> getBHEnv
let reqBody = RequestBodyLBS $ fromMaybe emptyBody body
req <- reqHook $ initReq { method = dMethod
, requestBody = reqBody
, checkStatus = \_ _ _ -> Nothing}
req <- liftIO $ reqHook $ initReq { method = dMethod
, requestBody = reqBody
, checkStatus = \_ _ _ -> Nothing}
mgr <- bhManager <$> getBHEnv
liftIO $ httpLbs req mgr

View File

@ -2,7 +2,6 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE RankNTypes #-}
-------------------------------------------------------------------------------
-- |
@ -34,7 +33,7 @@ import Network.HTTP.Client
-}
data BHEnv = BHEnv { bhServer :: Server
, bhManager :: Manager
, bhRequestHook :: forall m. (MonadBH m) => Request -> m Request
, bhRequestHook :: Request -> IO Request
-- ^ Low-level hook that is run before every request is sent. Used to implement custom authentication strategies. Defaults to 'return' with 'mkBHEnv'.
}