@@ -28,24 +28,24 @@ type Response = HTTP.Response BL.ByteString
2828
2929data Signal = SIGINT | SIGKILL deriving (Eq, Show)
3030
31−data DockerClientOpts m = DockerClientOpts {
32− http :: Request -> m Response
33− , apiVer :: ApiVersion
31+data DockerClientOpts = DockerClientOpts {
32+ apiVer :: ApiVersion
3433 , baseUrl :: URL
3534 }
3635
37−type DockerT m a = ReaderT (DockerClientOpts m) (ExceptT String m) a
36+type HttpHandler m = Request -> m Response
3837
39−runDockerT :: (Monad m) => DockerClientOpts m -> DockerT m a -> m (Either String a)
38+type DockerT m a = ReaderT (DockerClientOpts, HttpHandler m) (ExceptT String m) a
39+
40+runDockerT :: (Monad m) => (DockerClientOpts, HttpHandler m) -> DockerT m a -> m (Either String a)
4041runDockerT opts a = runExceptT $ runReaderT a opts
4142-- runDockerT opts a = (runExceptT .) . flip runReaderT opts a
4243
4344data ListOpts = ListOpts { all :: Bool } deriving (Eq, Show)
4445
45−defaultClientOpts :: DockerClientOpts IO
46+defaultClientOpts :: DockerClientOpts
4647defaultClientOpts = DockerClientOpts {
47− http = undefined
48− , apiVer = "v1.22"
48+ apiVer = "v1.22"
4949 , baseUrl = "http://127.0.0.1:2375/"
5050 }
5151