mirror of
https://github.com/typeable/bloodhound.git
synced 2024-12-02 14:34:23 +03:00
simplify type to IO
This commit is contained in:
parent
b8116737a0
commit
8801a3e580
@ -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
|
||||
|
||||
|
@ -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'.
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user