make HandshakeM an instance of Applicative.

This commit is contained in:
Vincent Hanquez 2013-12-11 16:36:35 +08:00
parent 2a09d51ba5
commit a223673eed

View file

@ -48,7 +48,7 @@ import Network.TLS.Crypto
import Network.TLS.Cipher import Network.TLS.Cipher
import Network.TLS.Compression import Network.TLS.Compression
import Network.TLS.Types import Network.TLS.Types
import Control.Applicative ((<$>)) import Control.Applicative (Applicative, (<$>))
import Control.Monad.State import Control.Monad.State
import Data.X509 (CertificateChain) import Data.X509 (CertificateChain)
@ -78,7 +78,7 @@ type ClientCertRequestData = ([CertificateType],
[DistinguishedName]) [DistinguishedName])
newtype HandshakeM a = HandshakeM { runHandshakeM :: State HandshakeState a } newtype HandshakeM a = HandshakeM { runHandshakeM :: State HandshakeState a }
deriving (Functor, Monad) deriving (Functor, Applicative, Monad)
instance MonadState HandshakeState HandshakeM where instance MonadState HandshakeState HandshakeM where
put x = HandshakeM (put x) put x = HandshakeM (put x)