~singpolyma/haskell-gnutls

204007a4ef22c0f4fd68dbdd07328c3b03fc6396 — Stephen Paul Weber 1 year, 7 months ago 5a786ce
runTLS' for when the caller is also using ExceptT
1 files changed, 5 insertions(+), 1 deletions(-)

M lib/Network/Protocol/TLS/GNU.hs
M lib/Network/Protocol/TLS/GNU.hs => lib/Network/Protocol/TLS/GNU.hs +5 -1
@@ 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