@@ 23,6 23,7 @@ module Network.Protocol.TLS.GNU
, fromExceptT
, runTLS
+ , runTLS'
, runClient
, getSession
, handshake
@@ 98,7 99,10 @@ fromExceptT :: E.ExceptT Error UIO a -> TLS a
fromExceptT = E.mapExceptT lift
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 = do