~singpolyma/haskell-gnutls

ceac3318dab99fff87a062dd84759c2b43e4013d — Stephen Paul Weber 3 years ago 955b054
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