runTLS' for when the caller is also using ExceptT
This commit is contained in:
parent
955b054ff4
commit
ceac3318da
1 changed files with 5 additions and 1 deletions
|
@ -23,6 +23,7 @@ module Network.Protocol.TLS.GNU
|
||||||
, fromExceptT
|
, fromExceptT
|
||||||
|
|
||||||
, runTLS
|
, runTLS
|
||||||
|
, runTLS'
|
||||||
, runClient
|
, runClient
|
||||||
, getSession
|
, getSession
|
||||||
, handshake
|
, handshake
|
||||||
|
@ -98,7 +99,10 @@ fromExceptT :: E.ExceptT Error UIO a -> TLS a
|
||||||
fromExceptT = E.mapExceptT lift
|
fromExceptT = E.mapExceptT lift
|
||||||
|
|
||||||
runTLS :: (Unexceptional m) => Session -> TLS a -> m (Either Error a)
|
runTLS :: (Unexceptional m) => Session -> TLS a -> m (Either Error a)
|
||||||
runTLS s tls = UIO.lift $ R.runReaderT (E.runExceptT tls) s
|
runTLS s = E.runExceptT . runTLS' s
|
||||||
|
|
||||||
|
runTLS' :: (Unexceptional m) => Session -> TLS a -> E.ExceptT Error m a
|
||||||
|
runTLS' s = E.mapExceptT (UIO.lift . flip R.runReaderT s)
|
||||||
|
|
||||||
runClient :: Transport -> TLS a -> IO (Either Error a)
|
runClient :: Transport -> TLS a -> IO (Either Error a)
|
||||||
runClient transport tls = do
|
runClient transport tls = do
|
||||||
|
|
Loading…
Reference in a new issue