git.iko.soy/typeable/bloodhound
on master help sign in
simplify type to IO
commit8801a3e5800679e68e11db703d3bef1081dde523 authorMichael Xavier <michael@michaelxavier.net> dateThu 3 Dec 2015, 15:47 (11 years ago) parentb811673
2 files changed+4−5
src/Database/Bloodhound/Client.hs+3−3 src/Database/Bloodhound/Types/Internal.hs+1−2
src/Database/Bloodhound/Client.hs+3−3
@@ -176,9 +176,9 @@ dispatch dMethod url body = do
176176 initReq <- liftIO $ parseUrl' url
177177 reqHook <- bhRequestHook <$> getBHEnv
178178 let reqBody = RequestBodyLBS $ fromMaybe emptyBody body
179− req <- reqHook $ initReq { method = dMethod
180− , requestBody = reqBody
181− , checkStatus = \_ _ _ -> Nothing}
179+ req <- liftIO $ reqHook $ initReq { method = dMethod
180+ , requestBody = reqBody
181+ , checkStatus = \_ _ _ -> Nothing}
182182 mgr <- bhManager <$> getBHEnv
183183 liftIO $ httpLbs req mgr
184184
src/Database/Bloodhound/Types/Internal.hs+1−2
@@ -2,7 +2,6 @@
22{-# LANGUAGE DeriveGeneric #-}
33{-# LANGUAGE FlexibleInstances #-}
44{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5−{-# LANGUAGE RankNTypes #-}
65
76-------------------------------------------------------------------------------
87-- |
@@ -34,7 +33,7 @@ import Network.HTTP.Client
3433-}
3534data BHEnv = BHEnv { bhServer :: Server
3635 , bhManager :: Manager
37− , bhRequestHook :: forall m. (MonadBH m) => Request -> m Request
36+ , bhRequestHook :: Request -> IO Request
3837 -- ^ Low-level hook that is run before every request is sent. Used to implement custom authentication strategies. Defaults to 'return' with 'mkBHEnv'.
3938 }
4039