2021-09-16 14:03:01 +03:00
|
|
|
module Network.HTTP.Client.Manager
|
2021-01-09 02:09:15 +03:00
|
|
|
( HasHttpManagerM (..),
|
2021-09-16 14:03:01 +03:00
|
|
|
HTTP.Manager,
|
2021-01-09 02:09:15 +03:00
|
|
|
)
|
|
|
|
where
|
|
|
|
|
|
|
|
import Control.Monad.Except
|
|
|
|
import Control.Monad.Reader
|
|
|
|
import Control.Monad.State.Strict
|
|
|
|
import Control.Monad.Writer.Strict
|
|
|
|
import Network.HTTP.Client as HTTP
|
|
|
|
|
|
|
|
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
|