2021-09-16 14:03:01 +03:00
|
|
|
module Network.HTTP.Client.Manager
|
2021-09-24 01:56:37 +03:00
|
|
|
( HasHttpManagerM (..),
|
|
|
|
HTTP.Manager,
|
|
|
|
)
|
|
|
|
where
|
2021-01-09 02:09:15 +03:00
|
|
|
|
2021-09-24 01:56:37 +03:00
|
|
|
import Control.Monad.Except
|
|
|
|
import Control.Monad.Reader
|
|
|
|
import Control.Monad.State.Strict
|
|
|
|
import Control.Monad.Writer.Strict
|
|
|
|
import Network.HTTP.Client as HTTP
|
2021-01-09 02:09:15 +03:00
|
|
|
|
|
|
|
class (Monad m) => HasHttpManagerM m where
|
|
|
|
askHttpManager :: m HTTP.Manager
|
|
|
|
|
|
|
|
instance (HasHttpManagerM m) => HasHttpManagerM (ExceptT e m) where
|
|
|
|
askHttpManager = lift askHttpManager
|
2021-09-24 01:56:37 +03:00
|
|
|
|
2021-01-09 02:09:15 +03:00
|
|
|
instance (HasHttpManagerM m) => HasHttpManagerM (ReaderT r m) where
|
|
|
|
askHttpManager = lift askHttpManager
|
2021-09-24 01:56:37 +03:00
|
|
|
|
2021-01-09 02:09:15 +03:00
|
|
|
instance (HasHttpManagerM m) => HasHttpManagerM (StateT s m) where
|
|
|
|
askHttpManager = lift askHttpManager
|
2021-09-24 01:56:37 +03:00
|
|
|
|
2021-01-09 02:09:15 +03:00
|
|
|
instance (Monoid w, HasHttpManagerM m) => HasHttpManagerM (WriterT w m) where
|
|
|
|
askHttpManager = lift askHttpManager
|