{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Codec.Encryption.OpenPGP.Types.Internal.PacketClass where
import Codec.Encryption.OpenPGP.Types.Internal.Base
import Codec.Encryption.OpenPGP.Types.Internal.PKITypes
import Codec.Encryption.OpenPGP.Types.Internal.Pkt
import Control.Lens (makeLenses)
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as BL
import Data.Data (Data)
import Data.List.NonEmpty (NonEmpty)
import Data.Text (Text)
import Data.Typeable (Typeable)
import Data.Word (Word8)
import qualified Data.Kind
import Prettyprinter (Pretty(..))
class Packet a where
data PacketType a :: Data.Kind.Type
packetType :: a -> PacketType a
packetCode :: PacketType a -> Word8
dynamicPacketCode :: a -> Word8
toPkt :: a -> Pkt
fromPktMaybe :: Pkt -> Maybe a
fromPktEither :: Pkt -> Either String a
fromPktMaybe = (String -> Maybe a) -> (a -> Maybe a) -> Either String a -> Maybe a
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (Maybe a -> String -> Maybe a
forall a b. a -> b -> a
const Maybe a
forall a. Maybe a
Nothing) a -> Maybe a
forall a. a -> Maybe a
Just (Either String a -> Maybe a)
-> (Pkt -> Either String a) -> Pkt -> Maybe a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Pkt -> Either String a
forall a. Packet a => Pkt -> Either String a
fromPktEither
dynamicPacketCode = PacketType a -> PacketVersion
forall a. Packet a => PacketType a -> PacketVersion
packetCode (PacketType a -> PacketVersion)
-> (a -> PacketType a) -> a -> PacketVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> PacketType a
forall a. Packet a => a -> PacketType a
packetType
coercionError :: String -> Pkt -> Either String a
coercionError :: forall a. String -> Pkt -> Either String a
coercionError String
expected Pkt
pkt =
String -> Either String a
forall a b. a -> Either a b
Left
(String
"Cannot coerce non-" String -> String -> String
forall a. [a] -> [a] -> [a]
++
String
expected String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
" packet (tag " String -> String -> String
forall a. [a] -> [a] -> [a]
++ PacketVersion -> String
forall a. Show a => a -> String
show (Pkt -> PacketVersion
pktTag Pkt
pkt) String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
")")
data PKESK (v :: PKESKPayloadVersion) where
PKESK3Packet ::
PacketVersion
-> EightOctetKeyId
-> PubKeyAlgorithm
-> NonEmpty MPI
-> PKESK 'PKESKV3
PKESK6Packet ::
BL.ByteString
-> PubKeyAlgorithm
-> BL.ByteString
-> PKESK 'PKESKV6
deriving instance Eq (PKESK v)
deriving instance Show (PKESK v)
instance Packet (PKESK 'PKESKV3) where
data PacketType (PKESK 'PKESKV3) = PKESKType
deriving (Int -> PacketType (PKESK 'PKESKV3) -> String -> String
[PacketType (PKESK 'PKESKV3)] -> String -> String
PacketType (PKESK 'PKESKV3) -> String
(Int -> PacketType (PKESK 'PKESKV3) -> String -> String)
-> (PacketType (PKESK 'PKESKV3) -> String)
-> ([PacketType (PKESK 'PKESKV3)] -> String -> String)
-> Show (PacketType (PKESK 'PKESKV3))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType (PKESK 'PKESKV3) -> String -> String
showsPrec :: Int -> PacketType (PKESK 'PKESKV3) -> String -> String
$cshow :: PacketType (PKESK 'PKESKV3) -> String
show :: PacketType (PKESK 'PKESKV3) -> String
$cshowList :: [PacketType (PKESK 'PKESKV3)] -> String -> String
showList :: [PacketType (PKESK 'PKESKV3)] -> String -> String
Show, PacketType (PKESK 'PKESKV3)
-> PacketType (PKESK 'PKESKV3) -> NestedFlag
(PacketType (PKESK 'PKESKV3)
-> PacketType (PKESK 'PKESKV3) -> NestedFlag)
-> (PacketType (PKESK 'PKESKV3)
-> PacketType (PKESK 'PKESKV3) -> NestedFlag)
-> Eq (PacketType (PKESK 'PKESKV3))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (PKESK 'PKESKV3)
-> PacketType (PKESK 'PKESKV3) -> NestedFlag
== :: PacketType (PKESK 'PKESKV3)
-> PacketType (PKESK 'PKESKV3) -> NestedFlag
$c/= :: PacketType (PKESK 'PKESKV3)
-> PacketType (PKESK 'PKESKV3) -> NestedFlag
/= :: PacketType (PKESK 'PKESKV3)
-> PacketType (PKESK 'PKESKV3) -> NestedFlag
Eq)
packetType :: PKESK 'PKESKV3 -> PacketType (PKESK 'PKESKV3)
packetType PKESK 'PKESKV3
_ = PacketType (PKESK 'PKESKV3)
PKESKType
packetCode :: PacketType (PKESK 'PKESKV3) -> PacketVersion
packetCode PacketType (PKESK 'PKESKV3)
_ = PacketVersion
1
toPkt :: PKESK 'PKESKV3 -> Pkt
toPkt (PKESK3Packet PacketVersion
version EightOctetKeyId
keyid PubKeyAlgorithm
pka NonEmpty MPI
mpis) =
PKESKPayload -> Pkt
PKESKPkt (PKESKPayloadV3 -> PKESKPayload
PKESKPayloadV3Packet (PacketVersion
-> EightOctetKeyId
-> PubKeyAlgorithm
-> NonEmpty MPI
-> PKESKPayloadV3
PKESKPayloadV3 PacketVersion
version EightOctetKeyId
keyid PubKeyAlgorithm
pka NonEmpty MPI
mpis))
fromPktEither :: Pkt -> Either String (PKESK 'PKESKV3)
fromPktEither (PKESKPkt (PKESKPayloadV3Packet (PKESKPayloadV3 PacketVersion
_ EightOctetKeyId
keyid PubKeyAlgorithm
pka NonEmpty MPI
mpis))) =
PKESK 'PKESKV3 -> Either String (PKESK 'PKESKV3)
forall a b. b -> Either a b
Right (PacketVersion
-> EightOctetKeyId
-> PubKeyAlgorithm
-> NonEmpty MPI
-> PKESK 'PKESKV3
PKESK3Packet PacketVersion
3 EightOctetKeyId
keyid PubKeyAlgorithm
pka NonEmpty MPI
mpis)
fromPktEither (PKESKPkt (PKESKPayloadV6Packet (PKESKPayloadV6 ByteString
_ PubKeyAlgorithm
_ ByteString
_))) =
String -> Either String (PKESK 'PKESKV3)
forall a b. a -> Either a b
Left String
"Cannot coerce PKESKv6 packet to PKESKv3"
fromPktEither Pkt
pkt = String -> Pkt -> Either String (PKESK 'PKESKV3)
forall a. String -> Pkt -> Either String a
coercionError String
"PKESK" Pkt
pkt
instance Pretty (PKESK 'PKESKV3) where
pretty :: forall ann. PKESK 'PKESKV3 -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (PKESK 'PKESKV3 -> Pkt) -> PKESK 'PKESKV3 -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PKESK 'PKESKV3 -> Pkt
forall a. Packet a => a -> Pkt
toPkt
instance Packet (PKESK 'PKESKV6) where
data PacketType (PKESK 'PKESKV6) = PKESK6Type
deriving (Int -> PacketType (PKESK 'PKESKV6) -> String -> String
[PacketType (PKESK 'PKESKV6)] -> String -> String
PacketType (PKESK 'PKESKV6) -> String
(Int -> PacketType (PKESK 'PKESKV6) -> String -> String)
-> (PacketType (PKESK 'PKESKV6) -> String)
-> ([PacketType (PKESK 'PKESKV6)] -> String -> String)
-> Show (PacketType (PKESK 'PKESKV6))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType (PKESK 'PKESKV6) -> String -> String
showsPrec :: Int -> PacketType (PKESK 'PKESKV6) -> String -> String
$cshow :: PacketType (PKESK 'PKESKV6) -> String
show :: PacketType (PKESK 'PKESKV6) -> String
$cshowList :: [PacketType (PKESK 'PKESKV6)] -> String -> String
showList :: [PacketType (PKESK 'PKESKV6)] -> String -> String
Show, PacketType (PKESK 'PKESKV6)
-> PacketType (PKESK 'PKESKV6) -> NestedFlag
(PacketType (PKESK 'PKESKV6)
-> PacketType (PKESK 'PKESKV6) -> NestedFlag)
-> (PacketType (PKESK 'PKESKV6)
-> PacketType (PKESK 'PKESKV6) -> NestedFlag)
-> Eq (PacketType (PKESK 'PKESKV6))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (PKESK 'PKESKV6)
-> PacketType (PKESK 'PKESKV6) -> NestedFlag
== :: PacketType (PKESK 'PKESKV6)
-> PacketType (PKESK 'PKESKV6) -> NestedFlag
$c/= :: PacketType (PKESK 'PKESKV6)
-> PacketType (PKESK 'PKESKV6) -> NestedFlag
/= :: PacketType (PKESK 'PKESKV6)
-> PacketType (PKESK 'PKESKV6) -> NestedFlag
Eq)
packetType :: PKESK 'PKESKV6 -> PacketType (PKESK 'PKESKV6)
packetType PKESK 'PKESKV6
_ = PacketType (PKESK 'PKESKV6)
PKESK6Type
packetCode :: PacketType (PKESK 'PKESKV6) -> PacketVersion
packetCode PacketType (PKESK 'PKESKV6)
_ = PacketVersion
1
toPkt :: PKESK 'PKESKV6 -> Pkt
toPkt (PKESK6Packet ByteString
recipientKeyIdentifier PubKeyAlgorithm
pka ByteString
esk) =
PKESKPayload -> Pkt
PKESKPkt (PKESKPayloadV6 -> PKESKPayload
PKESKPayloadV6Packet (ByteString -> PubKeyAlgorithm -> ByteString -> PKESKPayloadV6
PKESKPayloadV6 ByteString
recipientKeyIdentifier PubKeyAlgorithm
pka ByteString
esk))
fromPktEither :: Pkt -> Either String (PKESK 'PKESKV6)
fromPktEither (PKESKPkt (PKESKPayloadV6Packet (PKESKPayloadV6 ByteString
recipientKeyIdentifier PubKeyAlgorithm
pka ByteString
esk))) =
PKESK 'PKESKV6 -> Either String (PKESK 'PKESKV6)
forall a b. b -> Either a b
Right (ByteString -> PubKeyAlgorithm -> ByteString -> PKESK 'PKESKV6
PKESK6Packet ByteString
recipientKeyIdentifier PubKeyAlgorithm
pka ByteString
esk)
fromPktEither (PKESKPkt (PKESKPayloadV3Packet (PKESKPayloadV3 PacketVersion
_ EightOctetKeyId
_ PubKeyAlgorithm
_ NonEmpty MPI
_))) =
String -> Either String (PKESK 'PKESKV6)
forall a b. a -> Either a b
Left String
"Cannot coerce PKESKv3 packet to PKESKv6"
fromPktEither Pkt
pkt = String -> Pkt -> Either String (PKESK 'PKESKV6)
forall a. String -> Pkt -> Either String a
coercionError String
"PKESKv6" Pkt
pkt
instance Pretty (PKESK 'PKESKV6) where
pretty :: forall ann. PKESK 'PKESKV6 -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (PKESK 'PKESKV6 -> Pkt) -> PKESK 'PKESKV6 -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PKESK 'PKESKV6 -> Pkt
forall a. Packet a => a -> Pkt
toPkt
newtype Signature =
Signature
{ Signature -> SignaturePayload
_signaturePayload :: SignaturePayload
}
deriving (Typeable Signature
Typeable Signature =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Signature -> c Signature)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Signature)
-> (Signature -> Constr)
-> (Signature -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Signature))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Signature))
-> ((forall b. Data b => b -> b) -> Signature -> Signature)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Signature -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Signature -> r)
-> (forall u. (forall d. Data d => d -> u) -> Signature -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> Signature -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature)
-> Data Signature
Signature -> Constr
Signature -> DataType
(forall b. Data b => b -> b) -> Signature -> Signature
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Signature -> u
forall u. (forall d. Data d => d -> u) -> Signature -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Signature -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Signature -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Signature
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Signature -> c Signature
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Signature)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Signature)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Signature -> c Signature
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Signature -> c Signature
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Signature
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Signature
$ctoConstr :: Signature -> Constr
toConstr :: Signature -> Constr
$cdataTypeOf :: Signature -> DataType
dataTypeOf :: Signature -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Signature)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Signature)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Signature)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Signature)
$cgmapT :: (forall b. Data b => b -> b) -> Signature -> Signature
gmapT :: (forall b. Data b => b -> b) -> Signature -> Signature
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Signature -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Signature -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Signature -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Signature -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Signature -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Signature -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Signature -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Signature -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Signature -> m Signature
Data, Signature -> Signature -> NestedFlag
(Signature -> Signature -> NestedFlag)
-> (Signature -> Signature -> NestedFlag) -> Eq Signature
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: Signature -> Signature -> NestedFlag
== :: Signature -> Signature -> NestedFlag
$c/= :: Signature -> Signature -> NestedFlag
/= :: Signature -> Signature -> NestedFlag
Eq, Int -> Signature -> String -> String
[Signature] -> String -> String
Signature -> String
(Int -> Signature -> String -> String)
-> (Signature -> String)
-> ([Signature] -> String -> String)
-> Show Signature
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> Signature -> String -> String
showsPrec :: Int -> Signature -> String -> String
$cshow :: Signature -> String
show :: Signature -> String
$cshowList :: [Signature] -> String -> String
showList :: [Signature] -> String -> String
Show, Typeable)
instance Packet Signature where
data PacketType Signature = SignatureType
deriving (Int -> PacketType Signature -> String -> String
[PacketType Signature] -> String -> String
PacketType Signature -> String
(Int -> PacketType Signature -> String -> String)
-> (PacketType Signature -> String)
-> ([PacketType Signature] -> String -> String)
-> Show (PacketType Signature)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType Signature -> String -> String
showsPrec :: Int -> PacketType Signature -> String -> String
$cshow :: PacketType Signature -> String
show :: PacketType Signature -> String
$cshowList :: [PacketType Signature] -> String -> String
showList :: [PacketType Signature] -> String -> String
Show, PacketType Signature -> PacketType Signature -> NestedFlag
(PacketType Signature -> PacketType Signature -> NestedFlag)
-> (PacketType Signature -> PacketType Signature -> NestedFlag)
-> Eq (PacketType Signature)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType Signature -> PacketType Signature -> NestedFlag
== :: PacketType Signature -> PacketType Signature -> NestedFlag
$c/= :: PacketType Signature -> PacketType Signature -> NestedFlag
/= :: PacketType Signature -> PacketType Signature -> NestedFlag
Eq)
packetType :: Signature -> PacketType Signature
packetType Signature
_ = PacketType Signature
SignatureType
packetCode :: PacketType Signature -> PacketVersion
packetCode PacketType Signature
_ = PacketVersion
2
toPkt :: Signature -> Pkt
toPkt (Signature SignaturePayload
a) = SignaturePayload -> Pkt
SignaturePkt SignaturePayload
a
fromPktMaybe :: Pkt -> Maybe Signature
fromPktMaybe (SignaturePkt SignaturePayload
a) = Signature -> Maybe Signature
forall a. a -> Maybe a
Just (SignaturePayload -> Signature
Signature SignaturePayload
a)
fromPktMaybe Pkt
_ = Maybe Signature
forall a. Maybe a
Nothing
fromPktEither :: Pkt -> Either String Signature
fromPktEither (SignaturePkt SignaturePayload
a) = Signature -> Either String Signature
forall a b. b -> Either a b
Right (SignaturePayload -> Signature
Signature SignaturePayload
a)
fromPktEither Pkt
pkt = String -> Pkt -> Either String Signature
forall a. String -> Pkt -> Either String a
coercionError String
"Signature" Pkt
pkt
instance Pretty Signature where
pretty :: forall ann. Signature -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann) -> (Signature -> Pkt) -> Signature -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Signature -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data SignatureV (v :: SignaturePayloadVersion) where
SignatureV3Packet :: SignaturePayloadV 'SigPayloadV3 -> SignatureV 'SigPayloadV3
SignatureV4Packet :: SignaturePayloadV 'SigPayloadV4 -> SignatureV 'SigPayloadV4
SignatureV6Packet :: SignaturePayloadV 'SigPayloadV6 -> SignatureV 'SigPayloadV6
SignatureVOtherPacket :: SignaturePayloadV 'SigPayloadVOther -> SignatureV 'SigPayloadVOther
deriving instance Eq (SignatureV v)
deriving instance Show (SignatureV v)
data SomeSignatureV where
SomeSignatureV :: SignatureV v -> SomeSignatureV
signaturePayloadFromSignatureV :: SignatureV v -> SignaturePayload
signaturePayloadFromSignatureV :: forall (v :: SignaturePayloadVersion).
SignatureV v -> SignaturePayload
signaturePayloadFromSignatureV (SignatureV3Packet SignaturePayloadV 'SigPayloadV3
payload) = SignaturePayloadV 'SigPayloadV3 -> SignaturePayload
forall (v :: SignaturePayloadVersion).
SignaturePayloadV v -> SignaturePayload
toSignaturePayload SignaturePayloadV 'SigPayloadV3
payload
signaturePayloadFromSignatureV (SignatureV4Packet SignaturePayloadV 'SigPayloadV4
payload) = SignaturePayloadV 'SigPayloadV4 -> SignaturePayload
forall (v :: SignaturePayloadVersion).
SignaturePayloadV v -> SignaturePayload
toSignaturePayload SignaturePayloadV 'SigPayloadV4
payload
signaturePayloadFromSignatureV (SignatureV6Packet SignaturePayloadV 'SigPayloadV6
payload) = SignaturePayloadV 'SigPayloadV6 -> SignaturePayload
forall (v :: SignaturePayloadVersion).
SignaturePayloadV v -> SignaturePayload
toSignaturePayload SignaturePayloadV 'SigPayloadV6
payload
signaturePayloadFromSignatureV (SignatureVOtherPacket SignaturePayloadV 'SigPayloadVOther
payload) = SignaturePayloadV 'SigPayloadVOther -> SignaturePayload
forall (v :: SignaturePayloadVersion).
SignaturePayloadV v -> SignaturePayload
toSignaturePayload SignaturePayloadV 'SigPayloadVOther
payload
fromPktEitherSomeSignatureV :: Pkt -> Either String SomeSignatureV
fromPktEitherSomeSignatureV :: Pkt -> Either String SomeSignatureV
fromPktEitherSomeSignatureV (SignaturePkt SignaturePayload
payload) =
SomeSignatureV -> Either String SomeSignatureV
forall a b. b -> Either a b
Right (SignaturePayload -> SomeSignatureV
someSignatureVFromPayload SignaturePayload
payload)
fromPktEitherSomeSignatureV Pkt
pkt =
String -> Pkt -> Either String SomeSignatureV
forall a. String -> Pkt -> Either String a
coercionError String
"Signature" Pkt
pkt
someSignatureVFromPayload :: SignaturePayload -> SomeSignatureV
someSignatureVFromPayload :: SignaturePayload -> SomeSignatureV
someSignatureVFromPayload SignaturePayload
payload =
case SignaturePayload -> SomeSignaturePayload
toSomeSignaturePayload SignaturePayload
payload of
SomeSignaturePayload (typedPayload :: SignaturePayloadV v
typedPayload@SigPayloadV3Data {}) ->
SignatureV 'SigPayloadV3 -> SomeSignatureV
forall (v :: SignaturePayloadVersion).
SignatureV v -> SomeSignatureV
SomeSignatureV (SignaturePayloadV 'SigPayloadV3 -> SignatureV 'SigPayloadV3
SignatureV3Packet SignaturePayloadV v
SignaturePayloadV 'SigPayloadV3
typedPayload)
SomeSignaturePayload (typedPayload :: SignaturePayloadV v
typedPayload@SigPayloadV4Data {}) ->
SignatureV 'SigPayloadV4 -> SomeSignatureV
forall (v :: SignaturePayloadVersion).
SignatureV v -> SomeSignatureV
SomeSignatureV (SignaturePayloadV 'SigPayloadV4 -> SignatureV 'SigPayloadV4
SignatureV4Packet SignaturePayloadV v
SignaturePayloadV 'SigPayloadV4
typedPayload)
SomeSignaturePayload (typedPayload :: SignaturePayloadV v
typedPayload@SigPayloadV6Data {}) ->
SignatureV 'SigPayloadV6 -> SomeSignatureV
forall (v :: SignaturePayloadVersion).
SignatureV v -> SomeSignatureV
SomeSignatureV (SignaturePayloadV 'SigPayloadV6 -> SignatureV 'SigPayloadV6
SignatureV6Packet SignaturePayloadV v
SignaturePayloadV 'SigPayloadV6
typedPayload)
SomeSignaturePayload (typedPayload :: SignaturePayloadV v
typedPayload@SigPayloadOtherData {}) ->
SignatureV 'SigPayloadVOther -> SomeSignatureV
forall (v :: SignaturePayloadVersion).
SignatureV v -> SomeSignatureV
SomeSignatureV (SignaturePayloadV 'SigPayloadVOther -> SignatureV 'SigPayloadVOther
SignatureVOtherPacket SignaturePayloadV v
SignaturePayloadV 'SigPayloadVOther
typedPayload)
instance Packet (SignatureV 'SigPayloadV3) where
data PacketType (SignatureV 'SigPayloadV3) = SignatureV3Type
deriving (Int -> PacketType (SignatureV 'SigPayloadV3) -> String -> String
[PacketType (SignatureV 'SigPayloadV3)] -> String -> String
PacketType (SignatureV 'SigPayloadV3) -> String
(Int -> PacketType (SignatureV 'SigPayloadV3) -> String -> String)
-> (PacketType (SignatureV 'SigPayloadV3) -> String)
-> ([PacketType (SignatureV 'SigPayloadV3)] -> String -> String)
-> Show (PacketType (SignatureV 'SigPayloadV3))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType (SignatureV 'SigPayloadV3) -> String -> String
showsPrec :: Int -> PacketType (SignatureV 'SigPayloadV3) -> String -> String
$cshow :: PacketType (SignatureV 'SigPayloadV3) -> String
show :: PacketType (SignatureV 'SigPayloadV3) -> String
$cshowList :: [PacketType (SignatureV 'SigPayloadV3)] -> String -> String
showList :: [PacketType (SignatureV 'SigPayloadV3)] -> String -> String
Show, PacketType (SignatureV 'SigPayloadV3)
-> PacketType (SignatureV 'SigPayloadV3) -> NestedFlag
(PacketType (SignatureV 'SigPayloadV3)
-> PacketType (SignatureV 'SigPayloadV3) -> NestedFlag)
-> (PacketType (SignatureV 'SigPayloadV3)
-> PacketType (SignatureV 'SigPayloadV3) -> NestedFlag)
-> Eq (PacketType (SignatureV 'SigPayloadV3))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (SignatureV 'SigPayloadV3)
-> PacketType (SignatureV 'SigPayloadV3) -> NestedFlag
== :: PacketType (SignatureV 'SigPayloadV3)
-> PacketType (SignatureV 'SigPayloadV3) -> NestedFlag
$c/= :: PacketType (SignatureV 'SigPayloadV3)
-> PacketType (SignatureV 'SigPayloadV3) -> NestedFlag
/= :: PacketType (SignatureV 'SigPayloadV3)
-> PacketType (SignatureV 'SigPayloadV3) -> NestedFlag
Eq)
packetType :: SignatureV 'SigPayloadV3 -> PacketType (SignatureV 'SigPayloadV3)
packetType SignatureV 'SigPayloadV3
_ = PacketType (SignatureV 'SigPayloadV3)
SignatureV3Type
packetCode :: PacketType (SignatureV 'SigPayloadV3) -> PacketVersion
packetCode PacketType (SignatureV 'SigPayloadV3)
_ = PacketVersion
2
toPkt :: SignatureV 'SigPayloadV3 -> Pkt
toPkt = SignaturePayload -> Pkt
SignaturePkt (SignaturePayload -> Pkt)
-> (SignatureV 'SigPayloadV3 -> SignaturePayload)
-> SignatureV 'SigPayloadV3
-> Pkt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SignatureV 'SigPayloadV3 -> SignaturePayload
forall (v :: SignaturePayloadVersion).
SignatureV v -> SignaturePayload
signaturePayloadFromSignatureV
fromPktEither :: Pkt -> Either String (SignatureV 'SigPayloadV3)
fromPktEither (SignaturePkt SignaturePayload
payload) =
SignaturePayloadV 'SigPayloadV3 -> SignatureV 'SigPayloadV3
SignatureV3Packet (SignaturePayloadV 'SigPayloadV3 -> SignatureV 'SigPayloadV3)
-> Either String (SignaturePayloadV 'SigPayloadV3)
-> Either String (SignatureV 'SigPayloadV3)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SignaturePayload -> Either String (SignaturePayloadV 'SigPayloadV3)
asSignaturePayloadV3 SignaturePayload
payload
fromPktEither Pkt
pkt = String -> Pkt -> Either String (SignatureV 'SigPayloadV3)
forall a. String -> Pkt -> Either String a
coercionError String
"SignatureV3" Pkt
pkt
instance Pretty (SignatureV 'SigPayloadV3) where
pretty :: forall ann. SignatureV 'SigPayloadV3 -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (SignatureV 'SigPayloadV3 -> Pkt)
-> SignatureV 'SigPayloadV3
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SignatureV 'SigPayloadV3 -> Pkt
forall a. Packet a => a -> Pkt
toPkt
instance Packet (SignatureV 'SigPayloadV4) where
data PacketType (SignatureV 'SigPayloadV4) = SignatureV4Type
deriving (Int -> PacketType (SignatureV 'SigPayloadV4) -> String -> String
[PacketType (SignatureV 'SigPayloadV4)] -> String -> String
PacketType (SignatureV 'SigPayloadV4) -> String
(Int -> PacketType (SignatureV 'SigPayloadV4) -> String -> String)
-> (PacketType (SignatureV 'SigPayloadV4) -> String)
-> ([PacketType (SignatureV 'SigPayloadV4)] -> String -> String)
-> Show (PacketType (SignatureV 'SigPayloadV4))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType (SignatureV 'SigPayloadV4) -> String -> String
showsPrec :: Int -> PacketType (SignatureV 'SigPayloadV4) -> String -> String
$cshow :: PacketType (SignatureV 'SigPayloadV4) -> String
show :: PacketType (SignatureV 'SigPayloadV4) -> String
$cshowList :: [PacketType (SignatureV 'SigPayloadV4)] -> String -> String
showList :: [PacketType (SignatureV 'SigPayloadV4)] -> String -> String
Show, PacketType (SignatureV 'SigPayloadV4)
-> PacketType (SignatureV 'SigPayloadV4) -> NestedFlag
(PacketType (SignatureV 'SigPayloadV4)
-> PacketType (SignatureV 'SigPayloadV4) -> NestedFlag)
-> (PacketType (SignatureV 'SigPayloadV4)
-> PacketType (SignatureV 'SigPayloadV4) -> NestedFlag)
-> Eq (PacketType (SignatureV 'SigPayloadV4))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (SignatureV 'SigPayloadV4)
-> PacketType (SignatureV 'SigPayloadV4) -> NestedFlag
== :: PacketType (SignatureV 'SigPayloadV4)
-> PacketType (SignatureV 'SigPayloadV4) -> NestedFlag
$c/= :: PacketType (SignatureV 'SigPayloadV4)
-> PacketType (SignatureV 'SigPayloadV4) -> NestedFlag
/= :: PacketType (SignatureV 'SigPayloadV4)
-> PacketType (SignatureV 'SigPayloadV4) -> NestedFlag
Eq)
packetType :: SignatureV 'SigPayloadV4 -> PacketType (SignatureV 'SigPayloadV4)
packetType SignatureV 'SigPayloadV4
_ = PacketType (SignatureV 'SigPayloadV4)
SignatureV4Type
packetCode :: PacketType (SignatureV 'SigPayloadV4) -> PacketVersion
packetCode PacketType (SignatureV 'SigPayloadV4)
_ = PacketVersion
2
toPkt :: SignatureV 'SigPayloadV4 -> Pkt
toPkt = SignaturePayload -> Pkt
SignaturePkt (SignaturePayload -> Pkt)
-> (SignatureV 'SigPayloadV4 -> SignaturePayload)
-> SignatureV 'SigPayloadV4
-> Pkt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SignatureV 'SigPayloadV4 -> SignaturePayload
forall (v :: SignaturePayloadVersion).
SignatureV v -> SignaturePayload
signaturePayloadFromSignatureV
fromPktEither :: Pkt -> Either String (SignatureV 'SigPayloadV4)
fromPktEither (SignaturePkt SignaturePayload
payload) =
SignaturePayloadV 'SigPayloadV4 -> SignatureV 'SigPayloadV4
SignatureV4Packet (SignaturePayloadV 'SigPayloadV4 -> SignatureV 'SigPayloadV4)
-> Either String (SignaturePayloadV 'SigPayloadV4)
-> Either String (SignatureV 'SigPayloadV4)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SignaturePayload -> Either String (SignaturePayloadV 'SigPayloadV4)
asSignaturePayloadV4 SignaturePayload
payload
fromPktEither Pkt
pkt = String -> Pkt -> Either String (SignatureV 'SigPayloadV4)
forall a. String -> Pkt -> Either String a
coercionError String
"SignatureV4" Pkt
pkt
instance Pretty (SignatureV 'SigPayloadV4) where
pretty :: forall ann. SignatureV 'SigPayloadV4 -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (SignatureV 'SigPayloadV4 -> Pkt)
-> SignatureV 'SigPayloadV4
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SignatureV 'SigPayloadV4 -> Pkt
forall a. Packet a => a -> Pkt
toPkt
instance Packet (SignatureV 'SigPayloadV6) where
data PacketType (SignatureV 'SigPayloadV6) = SignatureV6Type
deriving (Int -> PacketType (SignatureV 'SigPayloadV6) -> String -> String
[PacketType (SignatureV 'SigPayloadV6)] -> String -> String
PacketType (SignatureV 'SigPayloadV6) -> String
(Int -> PacketType (SignatureV 'SigPayloadV6) -> String -> String)
-> (PacketType (SignatureV 'SigPayloadV6) -> String)
-> ([PacketType (SignatureV 'SigPayloadV6)] -> String -> String)
-> Show (PacketType (SignatureV 'SigPayloadV6))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType (SignatureV 'SigPayloadV6) -> String -> String
showsPrec :: Int -> PacketType (SignatureV 'SigPayloadV6) -> String -> String
$cshow :: PacketType (SignatureV 'SigPayloadV6) -> String
show :: PacketType (SignatureV 'SigPayloadV6) -> String
$cshowList :: [PacketType (SignatureV 'SigPayloadV6)] -> String -> String
showList :: [PacketType (SignatureV 'SigPayloadV6)] -> String -> String
Show, PacketType (SignatureV 'SigPayloadV6)
-> PacketType (SignatureV 'SigPayloadV6) -> NestedFlag
(PacketType (SignatureV 'SigPayloadV6)
-> PacketType (SignatureV 'SigPayloadV6) -> NestedFlag)
-> (PacketType (SignatureV 'SigPayloadV6)
-> PacketType (SignatureV 'SigPayloadV6) -> NestedFlag)
-> Eq (PacketType (SignatureV 'SigPayloadV6))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (SignatureV 'SigPayloadV6)
-> PacketType (SignatureV 'SigPayloadV6) -> NestedFlag
== :: PacketType (SignatureV 'SigPayloadV6)
-> PacketType (SignatureV 'SigPayloadV6) -> NestedFlag
$c/= :: PacketType (SignatureV 'SigPayloadV6)
-> PacketType (SignatureV 'SigPayloadV6) -> NestedFlag
/= :: PacketType (SignatureV 'SigPayloadV6)
-> PacketType (SignatureV 'SigPayloadV6) -> NestedFlag
Eq)
packetType :: SignatureV 'SigPayloadV6 -> PacketType (SignatureV 'SigPayloadV6)
packetType SignatureV 'SigPayloadV6
_ = PacketType (SignatureV 'SigPayloadV6)
SignatureV6Type
packetCode :: PacketType (SignatureV 'SigPayloadV6) -> PacketVersion
packetCode PacketType (SignatureV 'SigPayloadV6)
_ = PacketVersion
2
toPkt :: SignatureV 'SigPayloadV6 -> Pkt
toPkt = SignaturePayload -> Pkt
SignaturePkt (SignaturePayload -> Pkt)
-> (SignatureV 'SigPayloadV6 -> SignaturePayload)
-> SignatureV 'SigPayloadV6
-> Pkt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SignatureV 'SigPayloadV6 -> SignaturePayload
forall (v :: SignaturePayloadVersion).
SignatureV v -> SignaturePayload
signaturePayloadFromSignatureV
fromPktEither :: Pkt -> Either String (SignatureV 'SigPayloadV6)
fromPktEither (SignaturePkt SignaturePayload
payload) =
SignaturePayloadV 'SigPayloadV6 -> SignatureV 'SigPayloadV6
SignatureV6Packet (SignaturePayloadV 'SigPayloadV6 -> SignatureV 'SigPayloadV6)
-> Either String (SignaturePayloadV 'SigPayloadV6)
-> Either String (SignatureV 'SigPayloadV6)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SignaturePayload -> Either String (SignaturePayloadV 'SigPayloadV6)
asSignaturePayloadV6 SignaturePayload
payload
fromPktEither Pkt
pkt = String -> Pkt -> Either String (SignatureV 'SigPayloadV6)
forall a. String -> Pkt -> Either String a
coercionError String
"SignatureV6" Pkt
pkt
instance Pretty (SignatureV 'SigPayloadV6) where
pretty :: forall ann. SignatureV 'SigPayloadV6 -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (SignatureV 'SigPayloadV6 -> Pkt)
-> SignatureV 'SigPayloadV6
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SignatureV 'SigPayloadV6 -> Pkt
forall a. Packet a => a -> Pkt
toPkt
instance Packet (SignatureV 'SigPayloadVOther) where
data PacketType (SignatureV 'SigPayloadVOther) = SignatureVOtherType
deriving (Int
-> PacketType (SignatureV 'SigPayloadVOther) -> String -> String
[PacketType (SignatureV 'SigPayloadVOther)] -> String -> String
PacketType (SignatureV 'SigPayloadVOther) -> String
(Int
-> PacketType (SignatureV 'SigPayloadVOther) -> String -> String)
-> (PacketType (SignatureV 'SigPayloadVOther) -> String)
-> ([PacketType (SignatureV 'SigPayloadVOther)]
-> String -> String)
-> Show (PacketType (SignatureV 'SigPayloadVOther))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int
-> PacketType (SignatureV 'SigPayloadVOther) -> String -> String
showsPrec :: Int
-> PacketType (SignatureV 'SigPayloadVOther) -> String -> String
$cshow :: PacketType (SignatureV 'SigPayloadVOther) -> String
show :: PacketType (SignatureV 'SigPayloadVOther) -> String
$cshowList :: [PacketType (SignatureV 'SigPayloadVOther)] -> String -> String
showList :: [PacketType (SignatureV 'SigPayloadVOther)] -> String -> String
Show, PacketType (SignatureV 'SigPayloadVOther)
-> PacketType (SignatureV 'SigPayloadVOther) -> NestedFlag
(PacketType (SignatureV 'SigPayloadVOther)
-> PacketType (SignatureV 'SigPayloadVOther) -> NestedFlag)
-> (PacketType (SignatureV 'SigPayloadVOther)
-> PacketType (SignatureV 'SigPayloadVOther) -> NestedFlag)
-> Eq (PacketType (SignatureV 'SigPayloadVOther))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (SignatureV 'SigPayloadVOther)
-> PacketType (SignatureV 'SigPayloadVOther) -> NestedFlag
== :: PacketType (SignatureV 'SigPayloadVOther)
-> PacketType (SignatureV 'SigPayloadVOther) -> NestedFlag
$c/= :: PacketType (SignatureV 'SigPayloadVOther)
-> PacketType (SignatureV 'SigPayloadVOther) -> NestedFlag
/= :: PacketType (SignatureV 'SigPayloadVOther)
-> PacketType (SignatureV 'SigPayloadVOther) -> NestedFlag
Eq)
packetType :: SignatureV 'SigPayloadVOther
-> PacketType (SignatureV 'SigPayloadVOther)
packetType SignatureV 'SigPayloadVOther
_ = PacketType (SignatureV 'SigPayloadVOther)
SignatureVOtherType
packetCode :: PacketType (SignatureV 'SigPayloadVOther) -> PacketVersion
packetCode PacketType (SignatureV 'SigPayloadVOther)
_ = PacketVersion
2
toPkt :: SignatureV 'SigPayloadVOther -> Pkt
toPkt = SignaturePayload -> Pkt
SignaturePkt (SignaturePayload -> Pkt)
-> (SignatureV 'SigPayloadVOther -> SignaturePayload)
-> SignatureV 'SigPayloadVOther
-> Pkt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SignatureV 'SigPayloadVOther -> SignaturePayload
forall (v :: SignaturePayloadVersion).
SignatureV v -> SignaturePayload
signaturePayloadFromSignatureV
fromPktEither :: Pkt -> Either String (SignatureV 'SigPayloadVOther)
fromPktEither (SignaturePkt SignaturePayload
payload) =
SignaturePayloadV 'SigPayloadVOther -> SignatureV 'SigPayloadVOther
SignatureVOtherPacket (SignaturePayloadV 'SigPayloadVOther
-> SignatureV 'SigPayloadVOther)
-> Either String (SignaturePayloadV 'SigPayloadVOther)
-> Either String (SignatureV 'SigPayloadVOther)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> SignaturePayload
-> Either String (SignaturePayloadV 'SigPayloadVOther)
asSignaturePayloadOther SignaturePayload
payload
fromPktEither Pkt
pkt = String -> Pkt -> Either String (SignatureV 'SigPayloadVOther)
forall a. String -> Pkt -> Either String a
coercionError String
"SignatureVOther" Pkt
pkt
instance Pretty (SignatureV 'SigPayloadVOther) where
pretty :: forall ann. SignatureV 'SigPayloadVOther -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (SignatureV 'SigPayloadVOther -> Pkt)
-> SignatureV 'SigPayloadVOther
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SignatureV 'SigPayloadVOther -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data SKESK (v :: SKESKPayloadVersion) where
SKESK4Packet ::
SymmetricAlgorithm
-> S2K
-> Maybe BL.ByteString
-> SKESK 'SKESKV4
SKESK6Packet ::
SymmetricAlgorithm
-> AEADAlgorithm
-> S2K
-> BL.ByteString
-> BL.ByteString
-> BL.ByteString
-> SKESK 'SKESKV6
deriving instance Eq (SKESK v)
deriving instance Show (SKESK v)
instance Packet (SKESK 'SKESKV4) where
data PacketType (SKESK 'SKESKV4) = SKESKType
deriving (Int -> PacketType (SKESK 'SKESKV4) -> String -> String
[PacketType (SKESK 'SKESKV4)] -> String -> String
PacketType (SKESK 'SKESKV4) -> String
(Int -> PacketType (SKESK 'SKESKV4) -> String -> String)
-> (PacketType (SKESK 'SKESKV4) -> String)
-> ([PacketType (SKESK 'SKESKV4)] -> String -> String)
-> Show (PacketType (SKESK 'SKESKV4))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType (SKESK 'SKESKV4) -> String -> String
showsPrec :: Int -> PacketType (SKESK 'SKESKV4) -> String -> String
$cshow :: PacketType (SKESK 'SKESKV4) -> String
show :: PacketType (SKESK 'SKESKV4) -> String
$cshowList :: [PacketType (SKESK 'SKESKV4)] -> String -> String
showList :: [PacketType (SKESK 'SKESKV4)] -> String -> String
Show, PacketType (SKESK 'SKESKV4)
-> PacketType (SKESK 'SKESKV4) -> NestedFlag
(PacketType (SKESK 'SKESKV4)
-> PacketType (SKESK 'SKESKV4) -> NestedFlag)
-> (PacketType (SKESK 'SKESKV4)
-> PacketType (SKESK 'SKESKV4) -> NestedFlag)
-> Eq (PacketType (SKESK 'SKESKV4))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (SKESK 'SKESKV4)
-> PacketType (SKESK 'SKESKV4) -> NestedFlag
== :: PacketType (SKESK 'SKESKV4)
-> PacketType (SKESK 'SKESKV4) -> NestedFlag
$c/= :: PacketType (SKESK 'SKESKV4)
-> PacketType (SKESK 'SKESKV4) -> NestedFlag
/= :: PacketType (SKESK 'SKESKV4)
-> PacketType (SKESK 'SKESKV4) -> NestedFlag
Eq)
packetType :: SKESK 'SKESKV4 -> PacketType (SKESK 'SKESKV4)
packetType SKESK 'SKESKV4
_ = PacketType (SKESK 'SKESKV4)
SKESKType
packetCode :: PacketType (SKESK 'SKESKV4) -> PacketVersion
packetCode PacketType (SKESK 'SKESKV4)
_ = PacketVersion
3
toPkt :: SKESK 'SKESKV4 -> Pkt
toPkt (SKESK4Packet SymmetricAlgorithm
symalgo S2K
s2k Maybe ByteString
esk) =
SKESKPayload -> Pkt
SKESKPkt (SKESKPayloadV4 -> SKESKPayload
SKESKPayloadV4Packet (SymmetricAlgorithm -> S2K -> Maybe ByteString -> SKESKPayloadV4
SKESKPayloadV4 SymmetricAlgorithm
symalgo S2K
s2k Maybe ByteString
esk))
fromPktEither :: Pkt -> Either String (SKESK 'SKESKV4)
fromPktEither (SKESKPkt (SKESKPayloadV4Packet (SKESKPayloadV4 SymmetricAlgorithm
symalgo S2K
s2k Maybe ByteString
esk))) =
SKESK 'SKESKV4 -> Either String (SKESK 'SKESKV4)
forall a b. b -> Either a b
Right (SymmetricAlgorithm -> S2K -> Maybe ByteString -> SKESK 'SKESKV4
SKESK4Packet SymmetricAlgorithm
symalgo S2K
s2k Maybe ByteString
esk)
fromPktEither (SKESKPkt (SKESKPayloadV6Packet (SKESKPayloadV6 SymmetricAlgorithm
_ AEADAlgorithm
_ S2K
_ ByteString
_ ByteString
_ ByteString
_))) =
String -> Either String (SKESK 'SKESKV4)
forall a b. a -> Either a b
Left String
"Cannot coerce SKESKv6 packet to SKESKv4"
fromPktEither Pkt
pkt = String -> Pkt -> Either String (SKESK 'SKESKV4)
forall a. String -> Pkt -> Either String a
coercionError String
"SKESK" Pkt
pkt
instance Pretty (SKESK 'SKESKV4) where
pretty :: forall ann. SKESK 'SKESKV4 -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (SKESK 'SKESKV4 -> Pkt) -> SKESK 'SKESKV4 -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SKESK 'SKESKV4 -> Pkt
forall a. Packet a => a -> Pkt
toPkt
instance Packet (SKESK 'SKESKV6) where
data PacketType (SKESK 'SKESKV6) = SKESK6Type
deriving (Int -> PacketType (SKESK 'SKESKV6) -> String -> String
[PacketType (SKESK 'SKESKV6)] -> String -> String
PacketType (SKESK 'SKESKV6) -> String
(Int -> PacketType (SKESK 'SKESKV6) -> String -> String)
-> (PacketType (SKESK 'SKESKV6) -> String)
-> ([PacketType (SKESK 'SKESKV6)] -> String -> String)
-> Show (PacketType (SKESK 'SKESKV6))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType (SKESK 'SKESKV6) -> String -> String
showsPrec :: Int -> PacketType (SKESK 'SKESKV6) -> String -> String
$cshow :: PacketType (SKESK 'SKESKV6) -> String
show :: PacketType (SKESK 'SKESKV6) -> String
$cshowList :: [PacketType (SKESK 'SKESKV6)] -> String -> String
showList :: [PacketType (SKESK 'SKESKV6)] -> String -> String
Show, PacketType (SKESK 'SKESKV6)
-> PacketType (SKESK 'SKESKV6) -> NestedFlag
(PacketType (SKESK 'SKESKV6)
-> PacketType (SKESK 'SKESKV6) -> NestedFlag)
-> (PacketType (SKESK 'SKESKV6)
-> PacketType (SKESK 'SKESKV6) -> NestedFlag)
-> Eq (PacketType (SKESK 'SKESKV6))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (SKESK 'SKESKV6)
-> PacketType (SKESK 'SKESKV6) -> NestedFlag
== :: PacketType (SKESK 'SKESKV6)
-> PacketType (SKESK 'SKESKV6) -> NestedFlag
$c/= :: PacketType (SKESK 'SKESKV6)
-> PacketType (SKESK 'SKESKV6) -> NestedFlag
/= :: PacketType (SKESK 'SKESKV6)
-> PacketType (SKESK 'SKESKV6) -> NestedFlag
Eq)
packetType :: SKESK 'SKESKV6 -> PacketType (SKESK 'SKESKV6)
packetType SKESK 'SKESKV6
_ = PacketType (SKESK 'SKESKV6)
SKESK6Type
packetCode :: PacketType (SKESK 'SKESKV6) -> PacketVersion
packetCode PacketType (SKESK 'SKESKV6)
_ = PacketVersion
3
toPkt :: SKESK 'SKESKV6 -> Pkt
toPkt (SKESK6Packet SymmetricAlgorithm
symalgo AEADAlgorithm
aead S2K
s2k ByteString
iv ByteString
esk ByteString
tag) =
SKESKPayload -> Pkt
SKESKPkt (SKESKPayloadV6 -> SKESKPayload
SKESKPayloadV6Packet (SymmetricAlgorithm
-> AEADAlgorithm
-> S2K
-> ByteString
-> ByteString
-> ByteString
-> SKESKPayloadV6
SKESKPayloadV6 SymmetricAlgorithm
symalgo AEADAlgorithm
aead S2K
s2k ByteString
iv ByteString
esk ByteString
tag))
fromPktEither :: Pkt -> Either String (SKESK 'SKESKV6)
fromPktEither (SKESKPkt (SKESKPayloadV6Packet (SKESKPayloadV6 SymmetricAlgorithm
symalgo AEADAlgorithm
aead S2K
s2k ByteString
iv ByteString
esk ByteString
tag))) =
SKESK 'SKESKV6 -> Either String (SKESK 'SKESKV6)
forall a b. b -> Either a b
Right (SymmetricAlgorithm
-> AEADAlgorithm
-> S2K
-> ByteString
-> ByteString
-> ByteString
-> SKESK 'SKESKV6
SKESK6Packet SymmetricAlgorithm
symalgo AEADAlgorithm
aead S2K
s2k ByteString
iv ByteString
esk ByteString
tag)
fromPktEither (SKESKPkt (SKESKPayloadV4Packet (SKESKPayloadV4 SymmetricAlgorithm
_ S2K
_ Maybe ByteString
_))) =
String -> Either String (SKESK 'SKESKV6)
forall a b. a -> Either a b
Left String
"Cannot coerce SKESKv4 packet to SKESKv6"
fromPktEither Pkt
pkt = String -> Pkt -> Either String (SKESK 'SKESKV6)
forall a. String -> Pkt -> Either String a
coercionError String
"SKESKv6" Pkt
pkt
instance Pretty (SKESK 'SKESKV6) where
pretty :: forall ann. SKESK 'SKESKV6 -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (SKESK 'SKESKV6 -> Pkt) -> SKESK 'SKESKV6 -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SKESK 'SKESKV6 -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data OnePassSignature (v :: OnePassSignatureVersion) where
OnePassSignatureV3Packet ::
PacketVersion
-> SigType
-> HashAlgorithm
-> PubKeyAlgorithm
-> EightOctetKeyId
-> NestedFlag
-> OnePassSignature 'OPSV3
OnePassSignatureV6Packet ::
SigType
-> HashAlgorithm
-> PubKeyAlgorithm
-> SignatureSalt
-> ByteString
-> NestedFlag
-> OnePassSignature 'OPSV6
deriving instance Eq (OnePassSignature v)
deriving instance Show (OnePassSignature v)
instance Packet (OnePassSignature 'OPSV3) where
data PacketType (OnePassSignature 'OPSV3) = OnePassSignatureType
deriving (Int -> PacketType (OnePassSignature 'OPSV3) -> String -> String
[PacketType (OnePassSignature 'OPSV3)] -> String -> String
PacketType (OnePassSignature 'OPSV3) -> String
(Int -> PacketType (OnePassSignature 'OPSV3) -> String -> String)
-> (PacketType (OnePassSignature 'OPSV3) -> String)
-> ([PacketType (OnePassSignature 'OPSV3)] -> String -> String)
-> Show (PacketType (OnePassSignature 'OPSV3))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType (OnePassSignature 'OPSV3) -> String -> String
showsPrec :: Int -> PacketType (OnePassSignature 'OPSV3) -> String -> String
$cshow :: PacketType (OnePassSignature 'OPSV3) -> String
show :: PacketType (OnePassSignature 'OPSV3) -> String
$cshowList :: [PacketType (OnePassSignature 'OPSV3)] -> String -> String
showList :: [PacketType (OnePassSignature 'OPSV3)] -> String -> String
Show, PacketType (OnePassSignature 'OPSV3)
-> PacketType (OnePassSignature 'OPSV3) -> NestedFlag
(PacketType (OnePassSignature 'OPSV3)
-> PacketType (OnePassSignature 'OPSV3) -> NestedFlag)
-> (PacketType (OnePassSignature 'OPSV3)
-> PacketType (OnePassSignature 'OPSV3) -> NestedFlag)
-> Eq (PacketType (OnePassSignature 'OPSV3))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (OnePassSignature 'OPSV3)
-> PacketType (OnePassSignature 'OPSV3) -> NestedFlag
== :: PacketType (OnePassSignature 'OPSV3)
-> PacketType (OnePassSignature 'OPSV3) -> NestedFlag
$c/= :: PacketType (OnePassSignature 'OPSV3)
-> PacketType (OnePassSignature 'OPSV3) -> NestedFlag
/= :: PacketType (OnePassSignature 'OPSV3)
-> PacketType (OnePassSignature 'OPSV3) -> NestedFlag
Eq)
packetType :: OnePassSignature 'OPSV3 -> PacketType (OnePassSignature 'OPSV3)
packetType OnePassSignature 'OPSV3
_ = PacketType (OnePassSignature 'OPSV3)
OnePassSignatureType
packetCode :: PacketType (OnePassSignature 'OPSV3) -> PacketVersion
packetCode PacketType (OnePassSignature 'OPSV3)
_ = PacketVersion
4
toPkt :: OnePassSignature 'OPSV3 -> Pkt
toPkt (OnePassSignatureV3Packet PacketVersion
a SigType
b HashAlgorithm
c PubKeyAlgorithm
d EightOctetKeyId
e NestedFlag
f) =
OnePassSignaturePayload -> Pkt
OnePassSignaturePkt (OPSPayloadV3 -> OnePassSignaturePayload
OPSPayloadV3Packet (PacketVersion
-> SigType
-> HashAlgorithm
-> PubKeyAlgorithm
-> EightOctetKeyId
-> NestedFlag
-> OPSPayloadV3
OPSPayloadV3 PacketVersion
a SigType
b HashAlgorithm
c PubKeyAlgorithm
d EightOctetKeyId
e NestedFlag
f))
fromPktEither :: Pkt -> Either String (OnePassSignature 'OPSV3)
fromPktEither (OnePassSignaturePkt (OPSPayloadV3Packet (OPSPayloadV3 PacketVersion
a SigType
b HashAlgorithm
c PubKeyAlgorithm
d EightOctetKeyId
e NestedFlag
f))) =
OnePassSignature 'OPSV3 -> Either String (OnePassSignature 'OPSV3)
forall a b. b -> Either a b
Right (PacketVersion
-> SigType
-> HashAlgorithm
-> PubKeyAlgorithm
-> EightOctetKeyId
-> NestedFlag
-> OnePassSignature 'OPSV3
OnePassSignatureV3Packet PacketVersion
a SigType
b HashAlgorithm
c PubKeyAlgorithm
d EightOctetKeyId
e NestedFlag
f)
fromPktEither Pkt
pkt = String -> Pkt -> Either String (OnePassSignature 'OPSV3)
forall a. String -> Pkt -> Either String a
coercionError String
"OnePassSignature" Pkt
pkt
instance Pretty (OnePassSignature 'OPSV3) where
pretty :: forall ann. OnePassSignature 'OPSV3 -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (OnePassSignature 'OPSV3 -> Pkt)
-> OnePassSignature 'OPSV3
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OnePassSignature 'OPSV3 -> Pkt
forall a. Packet a => a -> Pkt
toPkt
instance Packet (OnePassSignature 'OPSV6) where
data PacketType (OnePassSignature 'OPSV6) = OnePassSignatureV6Type
deriving (Int -> PacketType (OnePassSignature 'OPSV6) -> String -> String
[PacketType (OnePassSignature 'OPSV6)] -> String -> String
PacketType (OnePassSignature 'OPSV6) -> String
(Int -> PacketType (OnePassSignature 'OPSV6) -> String -> String)
-> (PacketType (OnePassSignature 'OPSV6) -> String)
-> ([PacketType (OnePassSignature 'OPSV6)] -> String -> String)
-> Show (PacketType (OnePassSignature 'OPSV6))
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType (OnePassSignature 'OPSV6) -> String -> String
showsPrec :: Int -> PacketType (OnePassSignature 'OPSV6) -> String -> String
$cshow :: PacketType (OnePassSignature 'OPSV6) -> String
show :: PacketType (OnePassSignature 'OPSV6) -> String
$cshowList :: [PacketType (OnePassSignature 'OPSV6)] -> String -> String
showList :: [PacketType (OnePassSignature 'OPSV6)] -> String -> String
Show, PacketType (OnePassSignature 'OPSV6)
-> PacketType (OnePassSignature 'OPSV6) -> NestedFlag
(PacketType (OnePassSignature 'OPSV6)
-> PacketType (OnePassSignature 'OPSV6) -> NestedFlag)
-> (PacketType (OnePassSignature 'OPSV6)
-> PacketType (OnePassSignature 'OPSV6) -> NestedFlag)
-> Eq (PacketType (OnePassSignature 'OPSV6))
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType (OnePassSignature 'OPSV6)
-> PacketType (OnePassSignature 'OPSV6) -> NestedFlag
== :: PacketType (OnePassSignature 'OPSV6)
-> PacketType (OnePassSignature 'OPSV6) -> NestedFlag
$c/= :: PacketType (OnePassSignature 'OPSV6)
-> PacketType (OnePassSignature 'OPSV6) -> NestedFlag
/= :: PacketType (OnePassSignature 'OPSV6)
-> PacketType (OnePassSignature 'OPSV6) -> NestedFlag
Eq)
packetType :: OnePassSignature 'OPSV6 -> PacketType (OnePassSignature 'OPSV6)
packetType OnePassSignature 'OPSV6
_ = PacketType (OnePassSignature 'OPSV6)
OnePassSignatureV6Type
packetCode :: PacketType (OnePassSignature 'OPSV6) -> PacketVersion
packetCode PacketType (OnePassSignature 'OPSV6)
_ = PacketVersion
4
toPkt :: OnePassSignature 'OPSV6 -> Pkt
toPkt (OnePassSignatureV6Packet SigType
a HashAlgorithm
b PubKeyAlgorithm
c SignatureSalt
d ByteString
e NestedFlag
f) =
OnePassSignaturePayload -> Pkt
OnePassSignaturePkt (OPSPayloadV6 -> OnePassSignaturePayload
OPSPayloadV6Packet (SigType
-> HashAlgorithm
-> PubKeyAlgorithm
-> SignatureSalt
-> ByteString
-> NestedFlag
-> OPSPayloadV6
OPSPayloadV6 SigType
a HashAlgorithm
b PubKeyAlgorithm
c SignatureSalt
d ByteString
e NestedFlag
f))
fromPktEither :: Pkt -> Either String (OnePassSignature 'OPSV6)
fromPktEither (OnePassSignaturePkt (OPSPayloadV6Packet (OPSPayloadV6 SigType
a HashAlgorithm
b PubKeyAlgorithm
c SignatureSalt
d ByteString
e NestedFlag
f))) =
OnePassSignature 'OPSV6 -> Either String (OnePassSignature 'OPSV6)
forall a b. b -> Either a b
Right (SigType
-> HashAlgorithm
-> PubKeyAlgorithm
-> SignatureSalt
-> ByteString
-> NestedFlag
-> OnePassSignature 'OPSV6
OnePassSignatureV6Packet SigType
a HashAlgorithm
b PubKeyAlgorithm
c SignatureSalt
d ByteString
e NestedFlag
f)
fromPktEither Pkt
pkt = String -> Pkt -> Either String (OnePassSignature 'OPSV6)
forall a. String -> Pkt -> Either String a
coercionError String
"OnePassSignatureV6" Pkt
pkt
instance Pretty (OnePassSignature 'OPSV6) where
pretty :: forall ann. OnePassSignature 'OPSV6 -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (OnePassSignature 'OPSV6 -> Pkt)
-> OnePassSignature 'OPSV6
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OnePassSignature 'OPSV6 -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data SecretKey =
SecretKey
{ SecretKey -> SomePKPayload
_secretKeyPKPayload :: SomePKPayload
, SecretKey -> SKAddendum
_secretKeySKAddendum :: SKAddendum
}
deriving (Typeable SecretKey
Typeable SecretKey =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SecretKey -> c SecretKey)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SecretKey)
-> (SecretKey -> Constr)
-> (SecretKey -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SecretKey))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SecretKey))
-> ((forall b. Data b => b -> b) -> SecretKey -> SecretKey)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SecretKey -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SecretKey -> r)
-> (forall u. (forall d. Data d => d -> u) -> SecretKey -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> SecretKey -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey)
-> Data SecretKey
SecretKey -> Constr
SecretKey -> DataType
(forall b. Data b => b -> b) -> SecretKey -> SecretKey
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> SecretKey -> u
forall u. (forall d. Data d => d -> u) -> SecretKey -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SecretKey -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SecretKey -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SecretKey
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SecretKey -> c SecretKey
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SecretKey)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SecretKey)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SecretKey -> c SecretKey
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SecretKey -> c SecretKey
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SecretKey
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SecretKey
$ctoConstr :: SecretKey -> Constr
toConstr :: SecretKey -> Constr
$cdataTypeOf :: SecretKey -> DataType
dataTypeOf :: SecretKey -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SecretKey)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SecretKey)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SecretKey)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SecretKey)
$cgmapT :: (forall b. Data b => b -> b) -> SecretKey -> SecretKey
gmapT :: (forall b. Data b => b -> b) -> SecretKey -> SecretKey
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SecretKey -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SecretKey -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SecretKey -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SecretKey -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SecretKey -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> SecretKey -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SecretKey -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SecretKey -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretKey -> m SecretKey
Data, SecretKey -> SecretKey -> NestedFlag
(SecretKey -> SecretKey -> NestedFlag)
-> (SecretKey -> SecretKey -> NestedFlag) -> Eq SecretKey
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: SecretKey -> SecretKey -> NestedFlag
== :: SecretKey -> SecretKey -> NestedFlag
$c/= :: SecretKey -> SecretKey -> NestedFlag
/= :: SecretKey -> SecretKey -> NestedFlag
Eq, Int -> SecretKey -> String -> String
[SecretKey] -> String -> String
SecretKey -> String
(Int -> SecretKey -> String -> String)
-> (SecretKey -> String)
-> ([SecretKey] -> String -> String)
-> Show SecretKey
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> SecretKey -> String -> String
showsPrec :: Int -> SecretKey -> String -> String
$cshow :: SecretKey -> String
show :: SecretKey -> String
$cshowList :: [SecretKey] -> String -> String
showList :: [SecretKey] -> String -> String
Show, Typeable)
instance Packet SecretKey where
data PacketType SecretKey = SecretKeyType
deriving (Int -> PacketType SecretKey -> String -> String
[PacketType SecretKey] -> String -> String
PacketType SecretKey -> String
(Int -> PacketType SecretKey -> String -> String)
-> (PacketType SecretKey -> String)
-> ([PacketType SecretKey] -> String -> String)
-> Show (PacketType SecretKey)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType SecretKey -> String -> String
showsPrec :: Int -> PacketType SecretKey -> String -> String
$cshow :: PacketType SecretKey -> String
show :: PacketType SecretKey -> String
$cshowList :: [PacketType SecretKey] -> String -> String
showList :: [PacketType SecretKey] -> String -> String
Show, PacketType SecretKey -> PacketType SecretKey -> NestedFlag
(PacketType SecretKey -> PacketType SecretKey -> NestedFlag)
-> (PacketType SecretKey -> PacketType SecretKey -> NestedFlag)
-> Eq (PacketType SecretKey)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType SecretKey -> PacketType SecretKey -> NestedFlag
== :: PacketType SecretKey -> PacketType SecretKey -> NestedFlag
$c/= :: PacketType SecretKey -> PacketType SecretKey -> NestedFlag
/= :: PacketType SecretKey -> PacketType SecretKey -> NestedFlag
Eq)
packetType :: SecretKey -> PacketType SecretKey
packetType SecretKey
_ = PacketType SecretKey
SecretKeyType
packetCode :: PacketType SecretKey -> PacketVersion
packetCode PacketType SecretKey
_ = PacketVersion
5
toPkt :: SecretKey -> Pkt
toPkt (SecretKey SomePKPayload
a SKAddendum
b) = SomePKPayload -> SKAddendum -> Pkt
SecretKeyPkt SomePKPayload
a SKAddendum
b
fromPktEither :: Pkt -> Either String SecretKey
fromPktEither (SecretKeyPkt SomePKPayload
a SKAddendum
b) = SecretKey -> Either String SecretKey
forall a b. b -> Either a b
Right (SomePKPayload -> SKAddendum -> SecretKey
SecretKey SomePKPayload
a SKAddendum
b)
fromPktEither Pkt
pkt = String -> Pkt -> Either String SecretKey
forall a. String -> Pkt -> Either String a
coercionError String
"SecretKey" Pkt
pkt
instance Pretty SecretKey where
pretty :: forall ann. SecretKey -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann) -> (SecretKey -> Pkt) -> SecretKey -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SecretKey -> Pkt
forall a. Packet a => a -> Pkt
toPkt
newtype PublicKey =
PublicKey
{ PublicKey -> SomePKPayload
_publicKeyPKPayload :: SomePKPayload
}
deriving (Typeable PublicKey
Typeable PublicKey =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PublicKey -> c PublicKey)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PublicKey)
-> (PublicKey -> Constr)
-> (PublicKey -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PublicKey))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PublicKey))
-> ((forall b. Data b => b -> b) -> PublicKey -> PublicKey)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PublicKey -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PublicKey -> r)
-> (forall u. (forall d. Data d => d -> u) -> PublicKey -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> PublicKey -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey)
-> Data PublicKey
PublicKey -> Constr
PublicKey -> DataType
(forall b. Data b => b -> b) -> PublicKey -> PublicKey
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> PublicKey -> u
forall u. (forall d. Data d => d -> u) -> PublicKey -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PublicKey -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PublicKey -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PublicKey
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PublicKey -> c PublicKey
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PublicKey)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PublicKey)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PublicKey -> c PublicKey
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PublicKey -> c PublicKey
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PublicKey
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PublicKey
$ctoConstr :: PublicKey -> Constr
toConstr :: PublicKey -> Constr
$cdataTypeOf :: PublicKey -> DataType
dataTypeOf :: PublicKey -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PublicKey)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PublicKey)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PublicKey)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PublicKey)
$cgmapT :: (forall b. Data b => b -> b) -> PublicKey -> PublicKey
gmapT :: (forall b. Data b => b -> b) -> PublicKey -> PublicKey
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PublicKey -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PublicKey -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PublicKey -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PublicKey -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PublicKey -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> PublicKey -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PublicKey -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PublicKey -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicKey -> m PublicKey
Data, PublicKey -> PublicKey -> NestedFlag
(PublicKey -> PublicKey -> NestedFlag)
-> (PublicKey -> PublicKey -> NestedFlag) -> Eq PublicKey
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PublicKey -> PublicKey -> NestedFlag
== :: PublicKey -> PublicKey -> NestedFlag
$c/= :: PublicKey -> PublicKey -> NestedFlag
/= :: PublicKey -> PublicKey -> NestedFlag
Eq, Int -> PublicKey -> String -> String
[PublicKey] -> String -> String
PublicKey -> String
(Int -> PublicKey -> String -> String)
-> (PublicKey -> String)
-> ([PublicKey] -> String -> String)
-> Show PublicKey
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PublicKey -> String -> String
showsPrec :: Int -> PublicKey -> String -> String
$cshow :: PublicKey -> String
show :: PublicKey -> String
$cshowList :: [PublicKey] -> String -> String
showList :: [PublicKey] -> String -> String
Show, Typeable)
instance Packet PublicKey where
data PacketType PublicKey = PublicKeyType
deriving (Int -> PacketType PublicKey -> String -> String
[PacketType PublicKey] -> String -> String
PacketType PublicKey -> String
(Int -> PacketType PublicKey -> String -> String)
-> (PacketType PublicKey -> String)
-> ([PacketType PublicKey] -> String -> String)
-> Show (PacketType PublicKey)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType PublicKey -> String -> String
showsPrec :: Int -> PacketType PublicKey -> String -> String
$cshow :: PacketType PublicKey -> String
show :: PacketType PublicKey -> String
$cshowList :: [PacketType PublicKey] -> String -> String
showList :: [PacketType PublicKey] -> String -> String
Show, PacketType PublicKey -> PacketType PublicKey -> NestedFlag
(PacketType PublicKey -> PacketType PublicKey -> NestedFlag)
-> (PacketType PublicKey -> PacketType PublicKey -> NestedFlag)
-> Eq (PacketType PublicKey)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType PublicKey -> PacketType PublicKey -> NestedFlag
== :: PacketType PublicKey -> PacketType PublicKey -> NestedFlag
$c/= :: PacketType PublicKey -> PacketType PublicKey -> NestedFlag
/= :: PacketType PublicKey -> PacketType PublicKey -> NestedFlag
Eq)
packetType :: PublicKey -> PacketType PublicKey
packetType PublicKey
_ = PacketType PublicKey
PublicKeyType
packetCode :: PacketType PublicKey -> PacketVersion
packetCode PacketType PublicKey
_ = PacketVersion
6
toPkt :: PublicKey -> Pkt
toPkt (PublicKey SomePKPayload
a) = SomePKPayload -> Pkt
PublicKeyPkt SomePKPayload
a
fromPktEither :: Pkt -> Either String PublicKey
fromPktEither (PublicKeyPkt SomePKPayload
a) = PublicKey -> Either String PublicKey
forall a b. b -> Either a b
Right (SomePKPayload -> PublicKey
PublicKey SomePKPayload
a)
fromPktEither Pkt
pkt = String -> Pkt -> Either String PublicKey
forall a. String -> Pkt -> Either String a
coercionError String
"PublicKey" Pkt
pkt
instance Pretty PublicKey where
pretty :: forall ann. PublicKey -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann) -> (PublicKey -> Pkt) -> PublicKey -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PublicKey -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data SecretSubkey =
SecretSubkey
{ SecretSubkey -> SomePKPayload
_secretSubkeyPKPayload :: SomePKPayload
, SecretSubkey -> SKAddendum
_secretSubkeySKAddendum :: SKAddendum
}
deriving (Typeable SecretSubkey
Typeable SecretSubkey =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SecretSubkey -> c SecretSubkey)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SecretSubkey)
-> (SecretSubkey -> Constr)
-> (SecretSubkey -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SecretSubkey))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SecretSubkey))
-> ((forall b. Data b => b -> b) -> SecretSubkey -> SecretSubkey)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SecretSubkey -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SecretSubkey -> r)
-> (forall u. (forall d. Data d => d -> u) -> SecretSubkey -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> SecretSubkey -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey)
-> Data SecretSubkey
SecretSubkey -> Constr
SecretSubkey -> DataType
(forall b. Data b => b -> b) -> SecretSubkey -> SecretSubkey
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> SecretSubkey -> u
forall u. (forall d. Data d => d -> u) -> SecretSubkey -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SecretSubkey -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SecretSubkey -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SecretSubkey
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SecretSubkey -> c SecretSubkey
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SecretSubkey)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SecretSubkey)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SecretSubkey -> c SecretSubkey
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SecretSubkey -> c SecretSubkey
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SecretSubkey
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SecretSubkey
$ctoConstr :: SecretSubkey -> Constr
toConstr :: SecretSubkey -> Constr
$cdataTypeOf :: SecretSubkey -> DataType
dataTypeOf :: SecretSubkey -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SecretSubkey)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SecretSubkey)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SecretSubkey)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SecretSubkey)
$cgmapT :: (forall b. Data b => b -> b) -> SecretSubkey -> SecretSubkey
gmapT :: (forall b. Data b => b -> b) -> SecretSubkey -> SecretSubkey
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SecretSubkey -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SecretSubkey -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SecretSubkey -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SecretSubkey -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SecretSubkey -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> SecretSubkey -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SecretSubkey -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SecretSubkey -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SecretSubkey -> m SecretSubkey
Data, SecretSubkey -> SecretSubkey -> NestedFlag
(SecretSubkey -> SecretSubkey -> NestedFlag)
-> (SecretSubkey -> SecretSubkey -> NestedFlag) -> Eq SecretSubkey
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: SecretSubkey -> SecretSubkey -> NestedFlag
== :: SecretSubkey -> SecretSubkey -> NestedFlag
$c/= :: SecretSubkey -> SecretSubkey -> NestedFlag
/= :: SecretSubkey -> SecretSubkey -> NestedFlag
Eq, Int -> SecretSubkey -> String -> String
[SecretSubkey] -> String -> String
SecretSubkey -> String
(Int -> SecretSubkey -> String -> String)
-> (SecretSubkey -> String)
-> ([SecretSubkey] -> String -> String)
-> Show SecretSubkey
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> SecretSubkey -> String -> String
showsPrec :: Int -> SecretSubkey -> String -> String
$cshow :: SecretSubkey -> String
show :: SecretSubkey -> String
$cshowList :: [SecretSubkey] -> String -> String
showList :: [SecretSubkey] -> String -> String
Show, Typeable)
instance Packet SecretSubkey where
data PacketType SecretSubkey = SecretSubkeyType
deriving (Int -> PacketType SecretSubkey -> String -> String
[PacketType SecretSubkey] -> String -> String
PacketType SecretSubkey -> String
(Int -> PacketType SecretSubkey -> String -> String)
-> (PacketType SecretSubkey -> String)
-> ([PacketType SecretSubkey] -> String -> String)
-> Show (PacketType SecretSubkey)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType SecretSubkey -> String -> String
showsPrec :: Int -> PacketType SecretSubkey -> String -> String
$cshow :: PacketType SecretSubkey -> String
show :: PacketType SecretSubkey -> String
$cshowList :: [PacketType SecretSubkey] -> String -> String
showList :: [PacketType SecretSubkey] -> String -> String
Show, PacketType SecretSubkey -> PacketType SecretSubkey -> NestedFlag
(PacketType SecretSubkey -> PacketType SecretSubkey -> NestedFlag)
-> (PacketType SecretSubkey
-> PacketType SecretSubkey -> NestedFlag)
-> Eq (PacketType SecretSubkey)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType SecretSubkey -> PacketType SecretSubkey -> NestedFlag
== :: PacketType SecretSubkey -> PacketType SecretSubkey -> NestedFlag
$c/= :: PacketType SecretSubkey -> PacketType SecretSubkey -> NestedFlag
/= :: PacketType SecretSubkey -> PacketType SecretSubkey -> NestedFlag
Eq)
packetType :: SecretSubkey -> PacketType SecretSubkey
packetType SecretSubkey
_ = PacketType SecretSubkey
SecretSubkeyType
packetCode :: PacketType SecretSubkey -> PacketVersion
packetCode PacketType SecretSubkey
_ = PacketVersion
7
toPkt :: SecretSubkey -> Pkt
toPkt (SecretSubkey SomePKPayload
a SKAddendum
b) = SomePKPayload -> SKAddendum -> Pkt
SecretSubkeyPkt SomePKPayload
a SKAddendum
b
fromPktEither :: Pkt -> Either String SecretSubkey
fromPktEither (SecretSubkeyPkt SomePKPayload
a SKAddendum
b) = SecretSubkey -> Either String SecretSubkey
forall a b. b -> Either a b
Right (SomePKPayload -> SKAddendum -> SecretSubkey
SecretSubkey SomePKPayload
a SKAddendum
b)
fromPktEither Pkt
pkt = String -> Pkt -> Either String SecretSubkey
forall a. String -> Pkt -> Either String a
coercionError String
"SecretSubkey" Pkt
pkt
instance Pretty SecretSubkey where
pretty :: forall ann. SecretSubkey -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (SecretSubkey -> Pkt) -> SecretSubkey -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SecretSubkey -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data CompressedData =
CompressedData
{ CompressedData -> CompressionAlgorithm
_compressedDataCompressionAlgorithm :: CompressionAlgorithm
, CompressedData -> ByteString
_compressedDataPayload :: CompressedDataPayload
}
deriving (Typeable CompressedData
Typeable CompressedData =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CompressedData -> c CompressedData)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CompressedData)
-> (CompressedData -> Constr)
-> (CompressedData -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CompressedData))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CompressedData))
-> ((forall b. Data b => b -> b)
-> CompressedData -> CompressedData)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CompressedData -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CompressedData -> r)
-> (forall u.
(forall d. Data d => d -> u) -> CompressedData -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> CompressedData -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData)
-> Data CompressedData
CompressedData -> Constr
CompressedData -> DataType
(forall b. Data b => b -> b) -> CompressedData -> CompressedData
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> CompressedData -> u
forall u. (forall d. Data d => d -> u) -> CompressedData -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CompressedData -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CompressedData -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CompressedData
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CompressedData -> c CompressedData
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CompressedData)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CompressedData)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CompressedData -> c CompressedData
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> CompressedData -> c CompressedData
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CompressedData
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CompressedData
$ctoConstr :: CompressedData -> Constr
toConstr :: CompressedData -> Constr
$cdataTypeOf :: CompressedData -> DataType
dataTypeOf :: CompressedData -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CompressedData)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CompressedData)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CompressedData)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CompressedData)
$cgmapT :: (forall b. Data b => b -> b) -> CompressedData -> CompressedData
gmapT :: (forall b. Data b => b -> b) -> CompressedData -> CompressedData
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CompressedData -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CompressedData -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CompressedData -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CompressedData -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> CompressedData -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> CompressedData -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CompressedData -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CompressedData -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressedData -> m CompressedData
Data, CompressedData -> CompressedData -> NestedFlag
(CompressedData -> CompressedData -> NestedFlag)
-> (CompressedData -> CompressedData -> NestedFlag)
-> Eq CompressedData
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: CompressedData -> CompressedData -> NestedFlag
== :: CompressedData -> CompressedData -> NestedFlag
$c/= :: CompressedData -> CompressedData -> NestedFlag
/= :: CompressedData -> CompressedData -> NestedFlag
Eq, Int -> CompressedData -> String -> String
[CompressedData] -> String -> String
CompressedData -> String
(Int -> CompressedData -> String -> String)
-> (CompressedData -> String)
-> ([CompressedData] -> String -> String)
-> Show CompressedData
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> CompressedData -> String -> String
showsPrec :: Int -> CompressedData -> String -> String
$cshow :: CompressedData -> String
show :: CompressedData -> String
$cshowList :: [CompressedData] -> String -> String
showList :: [CompressedData] -> String -> String
Show, Typeable)
instance Packet CompressedData where
data PacketType CompressedData = CompressedDataType
deriving (Int -> PacketType CompressedData -> String -> String
[PacketType CompressedData] -> String -> String
PacketType CompressedData -> String
(Int -> PacketType CompressedData -> String -> String)
-> (PacketType CompressedData -> String)
-> ([PacketType CompressedData] -> String -> String)
-> Show (PacketType CompressedData)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType CompressedData -> String -> String
showsPrec :: Int -> PacketType CompressedData -> String -> String
$cshow :: PacketType CompressedData -> String
show :: PacketType CompressedData -> String
$cshowList :: [PacketType CompressedData] -> String -> String
showList :: [PacketType CompressedData] -> String -> String
Show, PacketType CompressedData
-> PacketType CompressedData -> NestedFlag
(PacketType CompressedData
-> PacketType CompressedData -> NestedFlag)
-> (PacketType CompressedData
-> PacketType CompressedData -> NestedFlag)
-> Eq (PacketType CompressedData)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType CompressedData
-> PacketType CompressedData -> NestedFlag
== :: PacketType CompressedData
-> PacketType CompressedData -> NestedFlag
$c/= :: PacketType CompressedData
-> PacketType CompressedData -> NestedFlag
/= :: PacketType CompressedData
-> PacketType CompressedData -> NestedFlag
Eq)
packetType :: CompressedData -> PacketType CompressedData
packetType CompressedData
_ = PacketType CompressedData
CompressedDataType
packetCode :: PacketType CompressedData -> PacketVersion
packetCode PacketType CompressedData
_ = PacketVersion
8
toPkt :: CompressedData -> Pkt
toPkt (CompressedData CompressionAlgorithm
a ByteString
b) = CompressionAlgorithm -> ByteString -> Pkt
CompressedDataPkt CompressionAlgorithm
a ByteString
b
fromPktEither :: Pkt -> Either String CompressedData
fromPktEither (CompressedDataPkt CompressionAlgorithm
a ByteString
b) = CompressedData -> Either String CompressedData
forall a b. b -> Either a b
Right (CompressionAlgorithm -> ByteString -> CompressedData
CompressedData CompressionAlgorithm
a ByteString
b)
fromPktEither Pkt
pkt = String -> Pkt -> Either String CompressedData
forall a. String -> Pkt -> Either String a
coercionError String
"CompressedData" Pkt
pkt
instance Pretty CompressedData where
pretty :: forall ann. CompressedData -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (CompressedData -> Pkt) -> CompressedData -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CompressedData -> Pkt
forall a. Packet a => a -> Pkt
toPkt
newtype SymEncData =
SymEncData
{ SymEncData -> ByteString
_symEncDataPayload :: ByteString
}
deriving (Typeable SymEncData
Typeable SymEncData =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SymEncData -> c SymEncData)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymEncData)
-> (SymEncData -> Constr)
-> (SymEncData -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SymEncData))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SymEncData))
-> ((forall b. Data b => b -> b) -> SymEncData -> SymEncData)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymEncData -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymEncData -> r)
-> (forall u. (forall d. Data d => d -> u) -> SymEncData -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> SymEncData -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData)
-> Data SymEncData
SymEncData -> Constr
SymEncData -> DataType
(forall b. Data b => b -> b) -> SymEncData -> SymEncData
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> SymEncData -> u
forall u. (forall d. Data d => d -> u) -> SymEncData -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymEncData -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymEncData -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymEncData
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SymEncData -> c SymEncData
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SymEncData)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SymEncData)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SymEncData -> c SymEncData
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SymEncData -> c SymEncData
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymEncData
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymEncData
$ctoConstr :: SymEncData -> Constr
toConstr :: SymEncData -> Constr
$cdataTypeOf :: SymEncData -> DataType
dataTypeOf :: SymEncData -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SymEncData)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SymEncData)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SymEncData)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SymEncData)
$cgmapT :: (forall b. Data b => b -> b) -> SymEncData -> SymEncData
gmapT :: (forall b. Data b => b -> b) -> SymEncData -> SymEncData
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymEncData -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymEncData -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymEncData -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymEncData -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SymEncData -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> SymEncData -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SymEncData -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SymEncData -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SymEncData -> m SymEncData
Data, SymEncData -> SymEncData -> NestedFlag
(SymEncData -> SymEncData -> NestedFlag)
-> (SymEncData -> SymEncData -> NestedFlag) -> Eq SymEncData
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: SymEncData -> SymEncData -> NestedFlag
== :: SymEncData -> SymEncData -> NestedFlag
$c/= :: SymEncData -> SymEncData -> NestedFlag
/= :: SymEncData -> SymEncData -> NestedFlag
Eq, Int -> SymEncData -> String -> String
[SymEncData] -> String -> String
SymEncData -> String
(Int -> SymEncData -> String -> String)
-> (SymEncData -> String)
-> ([SymEncData] -> String -> String)
-> Show SymEncData
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> SymEncData -> String -> String
showsPrec :: Int -> SymEncData -> String -> String
$cshow :: SymEncData -> String
show :: SymEncData -> String
$cshowList :: [SymEncData] -> String -> String
showList :: [SymEncData] -> String -> String
Show, Typeable)
instance Packet SymEncData where
data PacketType SymEncData = SymEncDataType
deriving (Int -> PacketType SymEncData -> String -> String
[PacketType SymEncData] -> String -> String
PacketType SymEncData -> String
(Int -> PacketType SymEncData -> String -> String)
-> (PacketType SymEncData -> String)
-> ([PacketType SymEncData] -> String -> String)
-> Show (PacketType SymEncData)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType SymEncData -> String -> String
showsPrec :: Int -> PacketType SymEncData -> String -> String
$cshow :: PacketType SymEncData -> String
show :: PacketType SymEncData -> String
$cshowList :: [PacketType SymEncData] -> String -> String
showList :: [PacketType SymEncData] -> String -> String
Show, PacketType SymEncData -> PacketType SymEncData -> NestedFlag
(PacketType SymEncData -> PacketType SymEncData -> NestedFlag)
-> (PacketType SymEncData -> PacketType SymEncData -> NestedFlag)
-> Eq (PacketType SymEncData)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType SymEncData -> PacketType SymEncData -> NestedFlag
== :: PacketType SymEncData -> PacketType SymEncData -> NestedFlag
$c/= :: PacketType SymEncData -> PacketType SymEncData -> NestedFlag
/= :: PacketType SymEncData -> PacketType SymEncData -> NestedFlag
Eq)
packetType :: SymEncData -> PacketType SymEncData
packetType SymEncData
_ = PacketType SymEncData
SymEncDataType
packetCode :: PacketType SymEncData -> PacketVersion
packetCode PacketType SymEncData
_ = PacketVersion
9
toPkt :: SymEncData -> Pkt
toPkt (SymEncData ByteString
a) = ByteString -> Pkt
SymEncDataPkt ByteString
a
fromPktEither :: Pkt -> Either String SymEncData
fromPktEither (SymEncDataPkt ByteString
a) = SymEncData -> Either String SymEncData
forall a b. b -> Either a b
Right (ByteString -> SymEncData
SymEncData ByteString
a)
fromPktEither Pkt
pkt = String -> Pkt -> Either String SymEncData
forall a. String -> Pkt -> Either String a
coercionError String
"SymEncData" Pkt
pkt
instance Pretty SymEncData where
pretty :: forall ann. SymEncData -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann) -> (SymEncData -> Pkt) -> SymEncData -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SymEncData -> Pkt
forall a. Packet a => a -> Pkt
toPkt
newtype Marker =
Marker
{ Marker -> ByteString
_markerPayload :: ByteString
}
deriving (Typeable Marker
Typeable Marker =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Marker -> c Marker)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Marker)
-> (Marker -> Constr)
-> (Marker -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Marker))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Marker))
-> ((forall b. Data b => b -> b) -> Marker -> Marker)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Marker -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Marker -> r)
-> (forall u. (forall d. Data d => d -> u) -> Marker -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Marker -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker)
-> Data Marker
Marker -> Constr
Marker -> DataType
(forall b. Data b => b -> b) -> Marker -> Marker
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Marker -> u
forall u. (forall d. Data d => d -> u) -> Marker -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Marker -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Marker -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Marker
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Marker -> c Marker
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Marker)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Marker)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Marker -> c Marker
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Marker -> c Marker
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Marker
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Marker
$ctoConstr :: Marker -> Constr
toConstr :: Marker -> Constr
$cdataTypeOf :: Marker -> DataType
dataTypeOf :: Marker -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Marker)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Marker)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Marker)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Marker)
$cgmapT :: (forall b. Data b => b -> b) -> Marker -> Marker
gmapT :: (forall b. Data b => b -> b) -> Marker -> Marker
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Marker -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Marker -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Marker -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Marker -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Marker -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Marker -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Marker -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Marker -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Marker -> m Marker
Data, Marker -> Marker -> NestedFlag
(Marker -> Marker -> NestedFlag)
-> (Marker -> Marker -> NestedFlag) -> Eq Marker
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: Marker -> Marker -> NestedFlag
== :: Marker -> Marker -> NestedFlag
$c/= :: Marker -> Marker -> NestedFlag
/= :: Marker -> Marker -> NestedFlag
Eq, Int -> Marker -> String -> String
[Marker] -> String -> String
Marker -> String
(Int -> Marker -> String -> String)
-> (Marker -> String)
-> ([Marker] -> String -> String)
-> Show Marker
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> Marker -> String -> String
showsPrec :: Int -> Marker -> String -> String
$cshow :: Marker -> String
show :: Marker -> String
$cshowList :: [Marker] -> String -> String
showList :: [Marker] -> String -> String
Show, Typeable)
instance Packet Marker where
data PacketType Marker = MarkerType
deriving (Int -> PacketType Marker -> String -> String
[PacketType Marker] -> String -> String
PacketType Marker -> String
(Int -> PacketType Marker -> String -> String)
-> (PacketType Marker -> String)
-> ([PacketType Marker] -> String -> String)
-> Show (PacketType Marker)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType Marker -> String -> String
showsPrec :: Int -> PacketType Marker -> String -> String
$cshow :: PacketType Marker -> String
show :: PacketType Marker -> String
$cshowList :: [PacketType Marker] -> String -> String
showList :: [PacketType Marker] -> String -> String
Show, PacketType Marker -> PacketType Marker -> NestedFlag
(PacketType Marker -> PacketType Marker -> NestedFlag)
-> (PacketType Marker -> PacketType Marker -> NestedFlag)
-> Eq (PacketType Marker)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType Marker -> PacketType Marker -> NestedFlag
== :: PacketType Marker -> PacketType Marker -> NestedFlag
$c/= :: PacketType Marker -> PacketType Marker -> NestedFlag
/= :: PacketType Marker -> PacketType Marker -> NestedFlag
Eq)
packetType :: Marker -> PacketType Marker
packetType Marker
_ = PacketType Marker
MarkerType
packetCode :: PacketType Marker -> PacketVersion
packetCode PacketType Marker
_ = PacketVersion
10
toPkt :: Marker -> Pkt
toPkt (Marker ByteString
a) = ByteString -> Pkt
MarkerPkt ByteString
a
fromPktEither :: Pkt -> Either String Marker
fromPktEither (MarkerPkt ByteString
a) = Marker -> Either String Marker
forall a b. b -> Either a b
Right (ByteString -> Marker
Marker ByteString
a)
fromPktEither Pkt
pkt = String -> Pkt -> Either String Marker
forall a. String -> Pkt -> Either String a
coercionError String
"Marker" Pkt
pkt
instance Pretty Marker where
pretty :: forall ann. Marker -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann) -> (Marker -> Pkt) -> Marker -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Marker -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data LiteralData =
LiteralData
{ LiteralData -> DataType
_literalDataDataType :: DataType
, LiteralData -> ByteString
_literalDataFileName :: FileName
, LiteralData -> ThirtyTwoBitTimeStamp
_literalDataTimeStamp :: ThirtyTwoBitTimeStamp
, LiteralData -> ByteString
_literalDataPayload :: ByteString
}
deriving (Typeable LiteralData
Typeable LiteralData =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LiteralData -> c LiteralData)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LiteralData)
-> (LiteralData -> Constr)
-> (LiteralData -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LiteralData))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LiteralData))
-> ((forall b. Data b => b -> b) -> LiteralData -> LiteralData)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LiteralData -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LiteralData -> r)
-> (forall u. (forall d. Data d => d -> u) -> LiteralData -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> LiteralData -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData)
-> Data LiteralData
LiteralData -> Constr
LiteralData -> DataType
(forall b. Data b => b -> b) -> LiteralData -> LiteralData
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> LiteralData -> u
forall u. (forall d. Data d => d -> u) -> LiteralData -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LiteralData -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LiteralData -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LiteralData
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LiteralData -> c LiteralData
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LiteralData)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LiteralData)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LiteralData -> c LiteralData
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> LiteralData -> c LiteralData
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LiteralData
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c LiteralData
$ctoConstr :: LiteralData -> Constr
toConstr :: LiteralData -> Constr
$cdataTypeOf :: LiteralData -> DataType
dataTypeOf :: LiteralData -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LiteralData)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c LiteralData)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LiteralData)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c LiteralData)
$cgmapT :: (forall b. Data b => b -> b) -> LiteralData -> LiteralData
gmapT :: (forall b. Data b => b -> b) -> LiteralData -> LiteralData
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LiteralData -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> LiteralData -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LiteralData -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> LiteralData -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> LiteralData -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> LiteralData -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LiteralData -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LiteralData -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> LiteralData -> m LiteralData
Data, LiteralData -> LiteralData -> NestedFlag
(LiteralData -> LiteralData -> NestedFlag)
-> (LiteralData -> LiteralData -> NestedFlag) -> Eq LiteralData
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: LiteralData -> LiteralData -> NestedFlag
== :: LiteralData -> LiteralData -> NestedFlag
$c/= :: LiteralData -> LiteralData -> NestedFlag
/= :: LiteralData -> LiteralData -> NestedFlag
Eq, Int -> LiteralData -> String -> String
[LiteralData] -> String -> String
LiteralData -> String
(Int -> LiteralData -> String -> String)
-> (LiteralData -> String)
-> ([LiteralData] -> String -> String)
-> Show LiteralData
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> LiteralData -> String -> String
showsPrec :: Int -> LiteralData -> String -> String
$cshow :: LiteralData -> String
show :: LiteralData -> String
$cshowList :: [LiteralData] -> String -> String
showList :: [LiteralData] -> String -> String
Show, Typeable)
instance Packet LiteralData where
data PacketType LiteralData = LiteralDataType
deriving (Int -> PacketType LiteralData -> String -> String
[PacketType LiteralData] -> String -> String
PacketType LiteralData -> String
(Int -> PacketType LiteralData -> String -> String)
-> (PacketType LiteralData -> String)
-> ([PacketType LiteralData] -> String -> String)
-> Show (PacketType LiteralData)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType LiteralData -> String -> String
showsPrec :: Int -> PacketType LiteralData -> String -> String
$cshow :: PacketType LiteralData -> String
show :: PacketType LiteralData -> String
$cshowList :: [PacketType LiteralData] -> String -> String
showList :: [PacketType LiteralData] -> String -> String
Show, PacketType LiteralData -> PacketType LiteralData -> NestedFlag
(PacketType LiteralData -> PacketType LiteralData -> NestedFlag)
-> (PacketType LiteralData -> PacketType LiteralData -> NestedFlag)
-> Eq (PacketType LiteralData)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType LiteralData -> PacketType LiteralData -> NestedFlag
== :: PacketType LiteralData -> PacketType LiteralData -> NestedFlag
$c/= :: PacketType LiteralData -> PacketType LiteralData -> NestedFlag
/= :: PacketType LiteralData -> PacketType LiteralData -> NestedFlag
Eq)
packetType :: LiteralData -> PacketType LiteralData
packetType LiteralData
_ = PacketType LiteralData
LiteralDataType
packetCode :: PacketType LiteralData -> PacketVersion
packetCode PacketType LiteralData
_ = PacketVersion
11
toPkt :: LiteralData -> Pkt
toPkt (LiteralData DataType
a ByteString
b ThirtyTwoBitTimeStamp
c ByteString
d) = DataType
-> ByteString -> ThirtyTwoBitTimeStamp -> ByteString -> Pkt
LiteralDataPkt DataType
a ByteString
b ThirtyTwoBitTimeStamp
c ByteString
d
fromPktEither :: Pkt -> Either String LiteralData
fromPktEither (LiteralDataPkt DataType
a ByteString
b ThirtyTwoBitTimeStamp
c ByteString
d) = LiteralData -> Either String LiteralData
forall a b. b -> Either a b
Right (DataType
-> ByteString -> ThirtyTwoBitTimeStamp -> ByteString -> LiteralData
LiteralData DataType
a ByteString
b ThirtyTwoBitTimeStamp
c ByteString
d)
fromPktEither Pkt
pkt = String -> Pkt -> Either String LiteralData
forall a. String -> Pkt -> Either String a
coercionError String
"LiteralData" Pkt
pkt
instance Pretty LiteralData where
pretty :: forall ann. LiteralData -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann) -> (LiteralData -> Pkt) -> LiteralData -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LiteralData -> Pkt
forall a. Packet a => a -> Pkt
toPkt
newtype Trust =
Trust
{ Trust -> ByteString
_trustPayload :: ByteString
}
deriving (Typeable Trust
Typeable Trust =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Trust -> c Trust)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Trust)
-> (Trust -> Constr)
-> (Trust -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Trust))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Trust))
-> ((forall b. Data b => b -> b) -> Trust -> Trust)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Trust -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Trust -> r)
-> (forall u. (forall d. Data d => d -> u) -> Trust -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Trust -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust)
-> Data Trust
Trust -> Constr
Trust -> DataType
(forall b. Data b => b -> b) -> Trust -> Trust
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Trust -> u
forall u. (forall d. Data d => d -> u) -> Trust -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Trust -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Trust -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Trust
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Trust -> c Trust
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Trust)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Trust)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Trust -> c Trust
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Trust -> c Trust
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Trust
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Trust
$ctoConstr :: Trust -> Constr
toConstr :: Trust -> Constr
$cdataTypeOf :: Trust -> DataType
dataTypeOf :: Trust -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Trust)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Trust)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Trust)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Trust)
$cgmapT :: (forall b. Data b => b -> b) -> Trust -> Trust
gmapT :: (forall b. Data b => b -> b) -> Trust -> Trust
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Trust -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Trust -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Trust -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Trust -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Trust -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Trust -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Trust -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Trust -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Trust -> m Trust
Data, Trust -> Trust -> NestedFlag
(Trust -> Trust -> NestedFlag)
-> (Trust -> Trust -> NestedFlag) -> Eq Trust
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: Trust -> Trust -> NestedFlag
== :: Trust -> Trust -> NestedFlag
$c/= :: Trust -> Trust -> NestedFlag
/= :: Trust -> Trust -> NestedFlag
Eq, Int -> Trust -> String -> String
[Trust] -> String -> String
Trust -> String
(Int -> Trust -> String -> String)
-> (Trust -> String) -> ([Trust] -> String -> String) -> Show Trust
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> Trust -> String -> String
showsPrec :: Int -> Trust -> String -> String
$cshow :: Trust -> String
show :: Trust -> String
$cshowList :: [Trust] -> String -> String
showList :: [Trust] -> String -> String
Show, Typeable)
instance Packet Trust where
data PacketType Trust = TrustType
deriving (Int -> PacketType Trust -> String -> String
[PacketType Trust] -> String -> String
PacketType Trust -> String
(Int -> PacketType Trust -> String -> String)
-> (PacketType Trust -> String)
-> ([PacketType Trust] -> String -> String)
-> Show (PacketType Trust)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType Trust -> String -> String
showsPrec :: Int -> PacketType Trust -> String -> String
$cshow :: PacketType Trust -> String
show :: PacketType Trust -> String
$cshowList :: [PacketType Trust] -> String -> String
showList :: [PacketType Trust] -> String -> String
Show, PacketType Trust -> PacketType Trust -> NestedFlag
(PacketType Trust -> PacketType Trust -> NestedFlag)
-> (PacketType Trust -> PacketType Trust -> NestedFlag)
-> Eq (PacketType Trust)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType Trust -> PacketType Trust -> NestedFlag
== :: PacketType Trust -> PacketType Trust -> NestedFlag
$c/= :: PacketType Trust -> PacketType Trust -> NestedFlag
/= :: PacketType Trust -> PacketType Trust -> NestedFlag
Eq)
packetType :: Trust -> PacketType Trust
packetType Trust
_ = PacketType Trust
TrustType
packetCode :: PacketType Trust -> PacketVersion
packetCode PacketType Trust
_ = PacketVersion
12
toPkt :: Trust -> Pkt
toPkt (Trust ByteString
a) = ByteString -> Pkt
TrustPkt ByteString
a
fromPktEither :: Pkt -> Either String Trust
fromPktEither (TrustPkt ByteString
a) = Trust -> Either String Trust
forall a b. b -> Either a b
Right (ByteString -> Trust
Trust ByteString
a)
fromPktEither Pkt
pkt = String -> Pkt -> Either String Trust
forall a. String -> Pkt -> Either String a
coercionError String
"Trust" Pkt
pkt
instance Pretty Trust where
pretty :: forall ann. Trust -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann) -> (Trust -> Pkt) -> Trust -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Trust -> Pkt
forall a. Packet a => a -> Pkt
toPkt
newtype UserId =
UserId
{ UserId -> Text
_userIdPayload :: Text
}
deriving (Typeable UserId
Typeable UserId =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserId -> c UserId)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserId)
-> (UserId -> Constr)
-> (UserId -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserId))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UserId))
-> ((forall b. Data b => b -> b) -> UserId -> UserId)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UserId -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UserId -> r)
-> (forall u. (forall d. Data d => d -> u) -> UserId -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> UserId -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId)
-> Data UserId
UserId -> Constr
UserId -> DataType
(forall b. Data b => b -> b) -> UserId -> UserId
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> UserId -> u
forall u. (forall d. Data d => d -> u) -> UserId -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserId
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserId -> c UserId
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserId)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UserId)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserId -> c UserId
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserId -> c UserId
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserId
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserId
$ctoConstr :: UserId -> Constr
toConstr :: UserId -> Constr
$cdataTypeOf :: UserId -> DataType
dataTypeOf :: UserId -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserId)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserId)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UserId)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UserId)
$cgmapT :: (forall b. Data b => b -> b) -> UserId -> UserId
gmapT :: (forall b. Data b => b -> b) -> UserId -> UserId
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UserId -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> UserId -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> UserId -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> UserId -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> UserId -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserId -> m UserId
Data, UserId -> UserId -> NestedFlag
(UserId -> UserId -> NestedFlag)
-> (UserId -> UserId -> NestedFlag) -> Eq UserId
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: UserId -> UserId -> NestedFlag
== :: UserId -> UserId -> NestedFlag
$c/= :: UserId -> UserId -> NestedFlag
/= :: UserId -> UserId -> NestedFlag
Eq, Int -> UserId -> String -> String
[UserId] -> String -> String
UserId -> String
(Int -> UserId -> String -> String)
-> (UserId -> String)
-> ([UserId] -> String -> String)
-> Show UserId
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> UserId -> String -> String
showsPrec :: Int -> UserId -> String -> String
$cshow :: UserId -> String
show :: UserId -> String
$cshowList :: [UserId] -> String -> String
showList :: [UserId] -> String -> String
Show, Typeable)
instance Packet UserId where
data PacketType UserId = UserIdType
deriving (Int -> PacketType UserId -> String -> String
[PacketType UserId] -> String -> String
PacketType UserId -> String
(Int -> PacketType UserId -> String -> String)
-> (PacketType UserId -> String)
-> ([PacketType UserId] -> String -> String)
-> Show (PacketType UserId)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType UserId -> String -> String
showsPrec :: Int -> PacketType UserId -> String -> String
$cshow :: PacketType UserId -> String
show :: PacketType UserId -> String
$cshowList :: [PacketType UserId] -> String -> String
showList :: [PacketType UserId] -> String -> String
Show, PacketType UserId -> PacketType UserId -> NestedFlag
(PacketType UserId -> PacketType UserId -> NestedFlag)
-> (PacketType UserId -> PacketType UserId -> NestedFlag)
-> Eq (PacketType UserId)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType UserId -> PacketType UserId -> NestedFlag
== :: PacketType UserId -> PacketType UserId -> NestedFlag
$c/= :: PacketType UserId -> PacketType UserId -> NestedFlag
/= :: PacketType UserId -> PacketType UserId -> NestedFlag
Eq)
packetType :: UserId -> PacketType UserId
packetType UserId
_ = PacketType UserId
UserIdType
packetCode :: PacketType UserId -> PacketVersion
packetCode PacketType UserId
_ = PacketVersion
13
toPkt :: UserId -> Pkt
toPkt (UserId Text
a) = Text -> Pkt
UserIdPkt Text
a
fromPktEither :: Pkt -> Either String UserId
fromPktEither (UserIdPkt Text
a) = UserId -> Either String UserId
forall a b. b -> Either a b
Right (Text -> UserId
UserId Text
a)
fromPktEither Pkt
pkt = String -> Pkt -> Either String UserId
forall a. String -> Pkt -> Either String a
coercionError String
"UserId" Pkt
pkt
instance Pretty UserId where
pretty :: forall ann. UserId -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann) -> (UserId -> Pkt) -> UserId -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UserId -> Pkt
forall a. Packet a => a -> Pkt
toPkt
newtype PublicSubkey =
PublicSubkey
{ PublicSubkey -> SomePKPayload
_publicSubkeyPKPayload :: SomePKPayload
}
deriving (Typeable PublicSubkey
Typeable PublicSubkey =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PublicSubkey -> c PublicSubkey)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PublicSubkey)
-> (PublicSubkey -> Constr)
-> (PublicSubkey -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PublicSubkey))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PublicSubkey))
-> ((forall b. Data b => b -> b) -> PublicSubkey -> PublicSubkey)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PublicSubkey -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PublicSubkey -> r)
-> (forall u. (forall d. Data d => d -> u) -> PublicSubkey -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> PublicSubkey -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey)
-> Data PublicSubkey
PublicSubkey -> Constr
PublicSubkey -> DataType
(forall b. Data b => b -> b) -> PublicSubkey -> PublicSubkey
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> PublicSubkey -> u
forall u. (forall d. Data d => d -> u) -> PublicSubkey -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PublicSubkey -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PublicSubkey -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PublicSubkey
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PublicSubkey -> c PublicSubkey
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PublicSubkey)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PublicSubkey)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PublicSubkey -> c PublicSubkey
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PublicSubkey -> c PublicSubkey
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PublicSubkey
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PublicSubkey
$ctoConstr :: PublicSubkey -> Constr
toConstr :: PublicSubkey -> Constr
$cdataTypeOf :: PublicSubkey -> DataType
dataTypeOf :: PublicSubkey -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PublicSubkey)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PublicSubkey)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PublicSubkey)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PublicSubkey)
$cgmapT :: (forall b. Data b => b -> b) -> PublicSubkey -> PublicSubkey
gmapT :: (forall b. Data b => b -> b) -> PublicSubkey -> PublicSubkey
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PublicSubkey -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PublicSubkey -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PublicSubkey -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PublicSubkey -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PublicSubkey -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> PublicSubkey -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PublicSubkey -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PublicSubkey -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PublicSubkey -> m PublicSubkey
Data, PublicSubkey -> PublicSubkey -> NestedFlag
(PublicSubkey -> PublicSubkey -> NestedFlag)
-> (PublicSubkey -> PublicSubkey -> NestedFlag) -> Eq PublicSubkey
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PublicSubkey -> PublicSubkey -> NestedFlag
== :: PublicSubkey -> PublicSubkey -> NestedFlag
$c/= :: PublicSubkey -> PublicSubkey -> NestedFlag
/= :: PublicSubkey -> PublicSubkey -> NestedFlag
Eq, Int -> PublicSubkey -> String -> String
[PublicSubkey] -> String -> String
PublicSubkey -> String
(Int -> PublicSubkey -> String -> String)
-> (PublicSubkey -> String)
-> ([PublicSubkey] -> String -> String)
-> Show PublicSubkey
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PublicSubkey -> String -> String
showsPrec :: Int -> PublicSubkey -> String -> String
$cshow :: PublicSubkey -> String
show :: PublicSubkey -> String
$cshowList :: [PublicSubkey] -> String -> String
showList :: [PublicSubkey] -> String -> String
Show, Typeable)
instance Packet PublicSubkey where
data PacketType PublicSubkey = PublicSubkeyType
deriving (Int -> PacketType PublicSubkey -> String -> String
[PacketType PublicSubkey] -> String -> String
PacketType PublicSubkey -> String
(Int -> PacketType PublicSubkey -> String -> String)
-> (PacketType PublicSubkey -> String)
-> ([PacketType PublicSubkey] -> String -> String)
-> Show (PacketType PublicSubkey)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType PublicSubkey -> String -> String
showsPrec :: Int -> PacketType PublicSubkey -> String -> String
$cshow :: PacketType PublicSubkey -> String
show :: PacketType PublicSubkey -> String
$cshowList :: [PacketType PublicSubkey] -> String -> String
showList :: [PacketType PublicSubkey] -> String -> String
Show, PacketType PublicSubkey -> PacketType PublicSubkey -> NestedFlag
(PacketType PublicSubkey -> PacketType PublicSubkey -> NestedFlag)
-> (PacketType PublicSubkey
-> PacketType PublicSubkey -> NestedFlag)
-> Eq (PacketType PublicSubkey)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType PublicSubkey -> PacketType PublicSubkey -> NestedFlag
== :: PacketType PublicSubkey -> PacketType PublicSubkey -> NestedFlag
$c/= :: PacketType PublicSubkey -> PacketType PublicSubkey -> NestedFlag
/= :: PacketType PublicSubkey -> PacketType PublicSubkey -> NestedFlag
Eq)
packetType :: PublicSubkey -> PacketType PublicSubkey
packetType PublicSubkey
_ = PacketType PublicSubkey
PublicSubkeyType
packetCode :: PacketType PublicSubkey -> PacketVersion
packetCode PacketType PublicSubkey
_ = PacketVersion
14
toPkt :: PublicSubkey -> Pkt
toPkt (PublicSubkey SomePKPayload
a) = SomePKPayload -> Pkt
PublicSubkeyPkt SomePKPayload
a
fromPktEither :: Pkt -> Either String PublicSubkey
fromPktEither (PublicSubkeyPkt SomePKPayload
a) = PublicSubkey -> Either String PublicSubkey
forall a b. b -> Either a b
Right (SomePKPayload -> PublicSubkey
PublicSubkey SomePKPayload
a)
fromPktEither Pkt
pkt = String -> Pkt -> Either String PublicSubkey
forall a. String -> Pkt -> Either String a
coercionError String
"PublicSubkey" Pkt
pkt
instance Pretty PublicSubkey where
pretty :: forall ann. PublicSubkey -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (PublicSubkey -> Pkt) -> PublicSubkey -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PublicSubkey -> Pkt
forall a. Packet a => a -> Pkt
toPkt
newtype UserAttribute =
UserAttribute
{ UserAttribute -> [UserAttrSubPacket]
_userAttributeSubPackets :: [UserAttrSubPacket]
}
deriving (Typeable UserAttribute
Typeable UserAttribute =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserAttribute -> c UserAttribute)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserAttribute)
-> (UserAttribute -> Constr)
-> (UserAttribute -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserAttribute))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UserAttribute))
-> ((forall b. Data b => b -> b) -> UserAttribute -> UserAttribute)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttribute -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttribute -> r)
-> (forall u. (forall d. Data d => d -> u) -> UserAttribute -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> UserAttribute -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute)
-> Data UserAttribute
UserAttribute -> Constr
UserAttribute -> DataType
(forall b. Data b => b -> b) -> UserAttribute -> UserAttribute
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> UserAttribute -> u
forall u. (forall d. Data d => d -> u) -> UserAttribute -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttribute -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttribute -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserAttribute
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserAttribute -> c UserAttribute
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserAttribute)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UserAttribute)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserAttribute -> c UserAttribute
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserAttribute -> c UserAttribute
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserAttribute
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserAttribute
$ctoConstr :: UserAttribute -> Constr
toConstr :: UserAttribute -> Constr
$cdataTypeOf :: UserAttribute -> DataType
dataTypeOf :: UserAttribute -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserAttribute)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserAttribute)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UserAttribute)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UserAttribute)
$cgmapT :: (forall b. Data b => b -> b) -> UserAttribute -> UserAttribute
gmapT :: (forall b. Data b => b -> b) -> UserAttribute -> UserAttribute
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttribute -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttribute -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttribute -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttribute -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> UserAttribute -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> UserAttribute -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> UserAttribute -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> UserAttribute -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UserAttribute -> m UserAttribute
Data, UserAttribute -> UserAttribute -> NestedFlag
(UserAttribute -> UserAttribute -> NestedFlag)
-> (UserAttribute -> UserAttribute -> NestedFlag)
-> Eq UserAttribute
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: UserAttribute -> UserAttribute -> NestedFlag
== :: UserAttribute -> UserAttribute -> NestedFlag
$c/= :: UserAttribute -> UserAttribute -> NestedFlag
/= :: UserAttribute -> UserAttribute -> NestedFlag
Eq, Int -> UserAttribute -> String -> String
[UserAttribute] -> String -> String
UserAttribute -> String
(Int -> UserAttribute -> String -> String)
-> (UserAttribute -> String)
-> ([UserAttribute] -> String -> String)
-> Show UserAttribute
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> UserAttribute -> String -> String
showsPrec :: Int -> UserAttribute -> String -> String
$cshow :: UserAttribute -> String
show :: UserAttribute -> String
$cshowList :: [UserAttribute] -> String -> String
showList :: [UserAttribute] -> String -> String
Show, Typeable)
instance Packet UserAttribute where
data PacketType UserAttribute = UserAttributeType
deriving (Int -> PacketType UserAttribute -> String -> String
[PacketType UserAttribute] -> String -> String
PacketType UserAttribute -> String
(Int -> PacketType UserAttribute -> String -> String)
-> (PacketType UserAttribute -> String)
-> ([PacketType UserAttribute] -> String -> String)
-> Show (PacketType UserAttribute)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType UserAttribute -> String -> String
showsPrec :: Int -> PacketType UserAttribute -> String -> String
$cshow :: PacketType UserAttribute -> String
show :: PacketType UserAttribute -> String
$cshowList :: [PacketType UserAttribute] -> String -> String
showList :: [PacketType UserAttribute] -> String -> String
Show, PacketType UserAttribute -> PacketType UserAttribute -> NestedFlag
(PacketType UserAttribute
-> PacketType UserAttribute -> NestedFlag)
-> (PacketType UserAttribute
-> PacketType UserAttribute -> NestedFlag)
-> Eq (PacketType UserAttribute)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType UserAttribute -> PacketType UserAttribute -> NestedFlag
== :: PacketType UserAttribute -> PacketType UserAttribute -> NestedFlag
$c/= :: PacketType UserAttribute -> PacketType UserAttribute -> NestedFlag
/= :: PacketType UserAttribute -> PacketType UserAttribute -> NestedFlag
Eq)
packetType :: UserAttribute -> PacketType UserAttribute
packetType UserAttribute
_ = PacketType UserAttribute
UserAttributeType
packetCode :: PacketType UserAttribute -> PacketVersion
packetCode PacketType UserAttribute
_ = PacketVersion
17
toPkt :: UserAttribute -> Pkt
toPkt (UserAttribute [UserAttrSubPacket]
a) = [UserAttrSubPacket] -> Pkt
UserAttributePkt [UserAttrSubPacket]
a
fromPktEither :: Pkt -> Either String UserAttribute
fromPktEither (UserAttributePkt [UserAttrSubPacket]
a) = UserAttribute -> Either String UserAttribute
forall a b. b -> Either a b
Right ([UserAttrSubPacket] -> UserAttribute
UserAttribute [UserAttrSubPacket]
a)
fromPktEither Pkt
pkt = String -> Pkt -> Either String UserAttribute
forall a. String -> Pkt -> Either String a
coercionError String
"UserAttribute" Pkt
pkt
instance Pretty UserAttribute where
pretty :: forall ann. UserAttribute -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (UserAttribute -> Pkt) -> UserAttribute -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UserAttribute -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data SymEncIntegrityProtectedData =
SymEncIntegrityProtectedData
{ SymEncIntegrityProtectedData -> PacketVersion
_symEncIntegrityProtectedDataPacketVersion :: PacketVersion
, SymEncIntegrityProtectedData -> ByteString
_symEncIntegrityProtectedDataPayload :: ByteString
}
| SymEncIntegrityProtectedDataV2
SymmetricAlgorithm
AEADAlgorithm
Word8
Salt
ByteString
deriving (Typeable SymEncIntegrityProtectedData
Typeable SymEncIntegrityProtectedData =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymEncIntegrityProtectedData
-> c SymEncIntegrityProtectedData)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c SymEncIntegrityProtectedData)
-> (SymEncIntegrityProtectedData -> Constr)
-> (SymEncIntegrityProtectedData -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c SymEncIntegrityProtectedData))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SymEncIntegrityProtectedData))
-> ((forall b. Data b => b -> b)
-> SymEncIntegrityProtectedData -> SymEncIntegrityProtectedData)
-> (forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> SymEncIntegrityProtectedData
-> r)
-> (forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> SymEncIntegrityProtectedData
-> r)
-> (forall u.
(forall d. Data d => d -> u)
-> SymEncIntegrityProtectedData -> [u])
-> (forall u.
Int
-> (forall d. Data d => d -> u)
-> SymEncIntegrityProtectedData
-> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData)
-> Data SymEncIntegrityProtectedData
SymEncIntegrityProtectedData -> Constr
SymEncIntegrityProtectedData -> DataType
(forall b. Data b => b -> b)
-> SymEncIntegrityProtectedData -> SymEncIntegrityProtectedData
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int
-> (forall d. Data d => d -> u)
-> SymEncIntegrityProtectedData
-> u
forall u.
(forall d. Data d => d -> u) -> SymEncIntegrityProtectedData -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> SymEncIntegrityProtectedData
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> SymEncIntegrityProtectedData
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymEncIntegrityProtectedData
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymEncIntegrityProtectedData
-> c SymEncIntegrityProtectedData
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c SymEncIntegrityProtectedData)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SymEncIntegrityProtectedData)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymEncIntegrityProtectedData
-> c SymEncIntegrityProtectedData
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymEncIntegrityProtectedData
-> c SymEncIntegrityProtectedData
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymEncIntegrityProtectedData
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymEncIntegrityProtectedData
$ctoConstr :: SymEncIntegrityProtectedData -> Constr
toConstr :: SymEncIntegrityProtectedData -> Constr
$cdataTypeOf :: SymEncIntegrityProtectedData -> DataType
dataTypeOf :: SymEncIntegrityProtectedData -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c SymEncIntegrityProtectedData)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c SymEncIntegrityProtectedData)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SymEncIntegrityProtectedData)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SymEncIntegrityProtectedData)
$cgmapT :: (forall b. Data b => b -> b)
-> SymEncIntegrityProtectedData -> SymEncIntegrityProtectedData
gmapT :: (forall b. Data b => b -> b)
-> SymEncIntegrityProtectedData -> SymEncIntegrityProtectedData
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> SymEncIntegrityProtectedData
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> SymEncIntegrityProtectedData
-> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> SymEncIntegrityProtectedData
-> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> SymEncIntegrityProtectedData
-> r
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> SymEncIntegrityProtectedData -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u) -> SymEncIntegrityProtectedData -> [u]
$cgmapQi :: forall u.
Int
-> (forall d. Data d => d -> u)
-> SymEncIntegrityProtectedData
-> u
gmapQi :: forall u.
Int
-> (forall d. Data d => d -> u)
-> SymEncIntegrityProtectedData
-> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymEncIntegrityProtectedData -> m SymEncIntegrityProtectedData
Data, SymEncIntegrityProtectedData
-> SymEncIntegrityProtectedData -> NestedFlag
(SymEncIntegrityProtectedData
-> SymEncIntegrityProtectedData -> NestedFlag)
-> (SymEncIntegrityProtectedData
-> SymEncIntegrityProtectedData -> NestedFlag)
-> Eq SymEncIntegrityProtectedData
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: SymEncIntegrityProtectedData
-> SymEncIntegrityProtectedData -> NestedFlag
== :: SymEncIntegrityProtectedData
-> SymEncIntegrityProtectedData -> NestedFlag
$c/= :: SymEncIntegrityProtectedData
-> SymEncIntegrityProtectedData -> NestedFlag
/= :: SymEncIntegrityProtectedData
-> SymEncIntegrityProtectedData -> NestedFlag
Eq, Int -> SymEncIntegrityProtectedData -> String -> String
[SymEncIntegrityProtectedData] -> String -> String
SymEncIntegrityProtectedData -> String
(Int -> SymEncIntegrityProtectedData -> String -> String)
-> (SymEncIntegrityProtectedData -> String)
-> ([SymEncIntegrityProtectedData] -> String -> String)
-> Show SymEncIntegrityProtectedData
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> SymEncIntegrityProtectedData -> String -> String
showsPrec :: Int -> SymEncIntegrityProtectedData -> String -> String
$cshow :: SymEncIntegrityProtectedData -> String
show :: SymEncIntegrityProtectedData -> String
$cshowList :: [SymEncIntegrityProtectedData] -> String -> String
showList :: [SymEncIntegrityProtectedData] -> String -> String
Show, Typeable)
instance Packet SymEncIntegrityProtectedData where
data PacketType
SymEncIntegrityProtectedData = SymEncIntegrityProtectedDataType
deriving (Int -> PacketType SymEncIntegrityProtectedData -> String -> String
[PacketType SymEncIntegrityProtectedData] -> String -> String
PacketType SymEncIntegrityProtectedData -> String
(Int
-> PacketType SymEncIntegrityProtectedData -> String -> String)
-> (PacketType SymEncIntegrityProtectedData -> String)
-> ([PacketType SymEncIntegrityProtectedData] -> String -> String)
-> Show (PacketType SymEncIntegrityProtectedData)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType SymEncIntegrityProtectedData -> String -> String
showsPrec :: Int -> PacketType SymEncIntegrityProtectedData -> String -> String
$cshow :: PacketType SymEncIntegrityProtectedData -> String
show :: PacketType SymEncIntegrityProtectedData -> String
$cshowList :: [PacketType SymEncIntegrityProtectedData] -> String -> String
showList :: [PacketType SymEncIntegrityProtectedData] -> String -> String
Show, PacketType SymEncIntegrityProtectedData
-> PacketType SymEncIntegrityProtectedData -> NestedFlag
(PacketType SymEncIntegrityProtectedData
-> PacketType SymEncIntegrityProtectedData -> NestedFlag)
-> (PacketType SymEncIntegrityProtectedData
-> PacketType SymEncIntegrityProtectedData -> NestedFlag)
-> Eq (PacketType SymEncIntegrityProtectedData)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType SymEncIntegrityProtectedData
-> PacketType SymEncIntegrityProtectedData -> NestedFlag
== :: PacketType SymEncIntegrityProtectedData
-> PacketType SymEncIntegrityProtectedData -> NestedFlag
$c/= :: PacketType SymEncIntegrityProtectedData
-> PacketType SymEncIntegrityProtectedData -> NestedFlag
/= :: PacketType SymEncIntegrityProtectedData
-> PacketType SymEncIntegrityProtectedData -> NestedFlag
Eq)
packetType :: SymEncIntegrityProtectedData
-> PacketType SymEncIntegrityProtectedData
packetType SymEncIntegrityProtectedData
_ = PacketType SymEncIntegrityProtectedData
SymEncIntegrityProtectedDataType
packetCode :: PacketType SymEncIntegrityProtectedData -> PacketVersion
packetCode PacketType SymEncIntegrityProtectedData
_ = PacketVersion
18
toPkt :: SymEncIntegrityProtectedData -> Pkt
toPkt (SymEncIntegrityProtectedData PacketVersion
a ByteString
b) = SEIPDPayload -> Pkt
SymEncIntegrityProtectedDataPkt (PacketVersion -> ByteString -> SEIPDPayload
SEIPD1 PacketVersion
a ByteString
b)
toPkt (SymEncIntegrityProtectedDataV2 SymmetricAlgorithm
a AEADAlgorithm
b PacketVersion
c Salt
d ByteString
e) =
SEIPDPayload -> Pkt
SymEncIntegrityProtectedDataPkt (SymmetricAlgorithm
-> AEADAlgorithm
-> PacketVersion
-> Salt
-> ByteString
-> SEIPDPayload
SEIPD2 SymmetricAlgorithm
a AEADAlgorithm
b PacketVersion
c Salt
d ByteString
e)
fromPktEither :: Pkt -> Either String SymEncIntegrityProtectedData
fromPktEither (SymEncIntegrityProtectedDataPkt (SEIPD1 PacketVersion
a ByteString
b)) =
SymEncIntegrityProtectedData
-> Either String SymEncIntegrityProtectedData
forall a b. b -> Either a b
Right (PacketVersion -> ByteString -> SymEncIntegrityProtectedData
SymEncIntegrityProtectedData PacketVersion
a ByteString
b)
fromPktEither (SymEncIntegrityProtectedDataPkt (SEIPD2 SymmetricAlgorithm
a AEADAlgorithm
b PacketVersion
c Salt
d ByteString
e)) =
SymEncIntegrityProtectedData
-> Either String SymEncIntegrityProtectedData
forall a b. b -> Either a b
Right (SymmetricAlgorithm
-> AEADAlgorithm
-> PacketVersion
-> Salt
-> ByteString
-> SymEncIntegrityProtectedData
SymEncIntegrityProtectedDataV2 SymmetricAlgorithm
a AEADAlgorithm
b PacketVersion
c Salt
d ByteString
e)
fromPktEither Pkt
pkt = String -> Pkt -> Either String SymEncIntegrityProtectedData
forall a. String -> Pkt -> Either String a
coercionError String
"SymEncIntegrityProtectedData" Pkt
pkt
instance Pretty SymEncIntegrityProtectedData where
pretty :: forall ann. SymEncIntegrityProtectedData -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (SymEncIntegrityProtectedData -> Pkt)
-> SymEncIntegrityProtectedData
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SymEncIntegrityProtectedData -> Pkt
forall a. Packet a => a -> Pkt
toPkt
newtype ModificationDetectionCode =
ModificationDetectionCode
{ ModificationDetectionCode -> ByteString
_modificationDetectionCodePayload :: ByteString
}
deriving (Typeable ModificationDetectionCode
Typeable ModificationDetectionCode =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModificationDetectionCode
-> c ModificationDetectionCode)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModificationDetectionCode)
-> (ModificationDetectionCode -> Constr)
-> (ModificationDetectionCode -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c ModificationDetectionCode))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModificationDetectionCode))
-> ((forall b. Data b => b -> b)
-> ModificationDetectionCode -> ModificationDetectionCode)
-> (forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModificationDetectionCode
-> r)
-> (forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModificationDetectionCode
-> r)
-> (forall u.
(forall d. Data d => d -> u) -> ModificationDetectionCode -> [u])
-> (forall u.
Int
-> (forall d. Data d => d -> u) -> ModificationDetectionCode -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode)
-> Data ModificationDetectionCode
ModificationDetectionCode -> Constr
ModificationDetectionCode -> DataType
(forall b. Data b => b -> b)
-> ModificationDetectionCode -> ModificationDetectionCode
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int
-> (forall d. Data d => d -> u) -> ModificationDetectionCode -> u
forall u.
(forall d. Data d => d -> u) -> ModificationDetectionCode -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModificationDetectionCode
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModificationDetectionCode
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModificationDetectionCode
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModificationDetectionCode
-> c ModificationDetectionCode
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c ModificationDetectionCode)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModificationDetectionCode)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModificationDetectionCode
-> c ModificationDetectionCode
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ModificationDetectionCode
-> c ModificationDetectionCode
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModificationDetectionCode
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ModificationDetectionCode
$ctoConstr :: ModificationDetectionCode -> Constr
toConstr :: ModificationDetectionCode -> Constr
$cdataTypeOf :: ModificationDetectionCode -> DataType
dataTypeOf :: ModificationDetectionCode -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c ModificationDetectionCode)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c ModificationDetectionCode)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModificationDetectionCode)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ModificationDetectionCode)
$cgmapT :: (forall b. Data b => b -> b)
-> ModificationDetectionCode -> ModificationDetectionCode
gmapT :: (forall b. Data b => b -> b)
-> ModificationDetectionCode -> ModificationDetectionCode
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModificationDetectionCode
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModificationDetectionCode
-> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModificationDetectionCode
-> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> ModificationDetectionCode
-> r
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> ModificationDetectionCode -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u) -> ModificationDetectionCode -> [u]
$cgmapQi :: forall u.
Int
-> (forall d. Data d => d -> u) -> ModificationDetectionCode -> u
gmapQi :: forall u.
Int
-> (forall d. Data d => d -> u) -> ModificationDetectionCode -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ModificationDetectionCode -> m ModificationDetectionCode
Data, ModificationDetectionCode
-> ModificationDetectionCode -> NestedFlag
(ModificationDetectionCode
-> ModificationDetectionCode -> NestedFlag)
-> (ModificationDetectionCode
-> ModificationDetectionCode -> NestedFlag)
-> Eq ModificationDetectionCode
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: ModificationDetectionCode
-> ModificationDetectionCode -> NestedFlag
== :: ModificationDetectionCode
-> ModificationDetectionCode -> NestedFlag
$c/= :: ModificationDetectionCode
-> ModificationDetectionCode -> NestedFlag
/= :: ModificationDetectionCode
-> ModificationDetectionCode -> NestedFlag
Eq, Int -> ModificationDetectionCode -> String -> String
[ModificationDetectionCode] -> String -> String
ModificationDetectionCode -> String
(Int -> ModificationDetectionCode -> String -> String)
-> (ModificationDetectionCode -> String)
-> ([ModificationDetectionCode] -> String -> String)
-> Show ModificationDetectionCode
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> ModificationDetectionCode -> String -> String
showsPrec :: Int -> ModificationDetectionCode -> String -> String
$cshow :: ModificationDetectionCode -> String
show :: ModificationDetectionCode -> String
$cshowList :: [ModificationDetectionCode] -> String -> String
showList :: [ModificationDetectionCode] -> String -> String
Show, Typeable)
instance Packet ModificationDetectionCode where
data PacketType
ModificationDetectionCode = ModificationDetectionCodeType
deriving (Int -> PacketType ModificationDetectionCode -> String -> String
[PacketType ModificationDetectionCode] -> String -> String
PacketType ModificationDetectionCode -> String
(Int -> PacketType ModificationDetectionCode -> String -> String)
-> (PacketType ModificationDetectionCode -> String)
-> ([PacketType ModificationDetectionCode] -> String -> String)
-> Show (PacketType ModificationDetectionCode)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType ModificationDetectionCode -> String -> String
showsPrec :: Int -> PacketType ModificationDetectionCode -> String -> String
$cshow :: PacketType ModificationDetectionCode -> String
show :: PacketType ModificationDetectionCode -> String
$cshowList :: [PacketType ModificationDetectionCode] -> String -> String
showList :: [PacketType ModificationDetectionCode] -> String -> String
Show, PacketType ModificationDetectionCode
-> PacketType ModificationDetectionCode -> NestedFlag
(PacketType ModificationDetectionCode
-> PacketType ModificationDetectionCode -> NestedFlag)
-> (PacketType ModificationDetectionCode
-> PacketType ModificationDetectionCode -> NestedFlag)
-> Eq (PacketType ModificationDetectionCode)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType ModificationDetectionCode
-> PacketType ModificationDetectionCode -> NestedFlag
== :: PacketType ModificationDetectionCode
-> PacketType ModificationDetectionCode -> NestedFlag
$c/= :: PacketType ModificationDetectionCode
-> PacketType ModificationDetectionCode -> NestedFlag
/= :: PacketType ModificationDetectionCode
-> PacketType ModificationDetectionCode -> NestedFlag
Eq)
packetType :: ModificationDetectionCode -> PacketType ModificationDetectionCode
packetType ModificationDetectionCode
_ = PacketType ModificationDetectionCode
ModificationDetectionCodeType
packetCode :: PacketType ModificationDetectionCode -> PacketVersion
packetCode PacketType ModificationDetectionCode
_ = PacketVersion
19
toPkt :: ModificationDetectionCode -> Pkt
toPkt (ModificationDetectionCode ByteString
a) = ByteString -> Pkt
ModificationDetectionCodePkt ByteString
a
fromPktEither :: Pkt -> Either String ModificationDetectionCode
fromPktEither (ModificationDetectionCodePkt ByteString
a) = ModificationDetectionCode
-> Either String ModificationDetectionCode
forall a b. b -> Either a b
Right (ByteString -> ModificationDetectionCode
ModificationDetectionCode ByteString
a)
fromPktEither Pkt
pkt = String -> Pkt -> Either String ModificationDetectionCode
forall a. String -> Pkt -> Either String a
coercionError String
"ModificationDetectionCode" Pkt
pkt
instance Pretty ModificationDetectionCode where
pretty :: forall ann. ModificationDetectionCode -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (ModificationDetectionCode -> Pkt)
-> ModificationDetectionCode
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ModificationDetectionCode -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data OtherPacket =
OtherPacket
{ OtherPacket -> PacketVersion
_otherPacketType :: Word8
, OtherPacket -> ByteString
_otherPacketPayload :: ByteString
}
deriving (Typeable OtherPacket
Typeable OtherPacket =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OtherPacket -> c OtherPacket)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OtherPacket)
-> (OtherPacket -> Constr)
-> (OtherPacket -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OtherPacket))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c OtherPacket))
-> ((forall b. Data b => b -> b) -> OtherPacket -> OtherPacket)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OtherPacket -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OtherPacket -> r)
-> (forall u. (forall d. Data d => d -> u) -> OtherPacket -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> OtherPacket -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket)
-> Data OtherPacket
OtherPacket -> Constr
OtherPacket -> DataType
(forall b. Data b => b -> b) -> OtherPacket -> OtherPacket
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> OtherPacket -> u
forall u. (forall d. Data d => d -> u) -> OtherPacket -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OtherPacket -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OtherPacket -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OtherPacket
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OtherPacket -> c OtherPacket
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OtherPacket)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c OtherPacket)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OtherPacket -> c OtherPacket
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> OtherPacket -> c OtherPacket
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OtherPacket
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c OtherPacket
$ctoConstr :: OtherPacket -> Constr
toConstr :: OtherPacket -> Constr
$cdataTypeOf :: OtherPacket -> DataType
dataTypeOf :: OtherPacket -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OtherPacket)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c OtherPacket)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c OtherPacket)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c OtherPacket)
$cgmapT :: (forall b. Data b => b -> b) -> OtherPacket -> OtherPacket
gmapT :: (forall b. Data b => b -> b) -> OtherPacket -> OtherPacket
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OtherPacket -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> OtherPacket -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OtherPacket -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> OtherPacket -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> OtherPacket -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> OtherPacket -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> OtherPacket -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> OtherPacket -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> OtherPacket -> m OtherPacket
Data, OtherPacket -> OtherPacket -> NestedFlag
(OtherPacket -> OtherPacket -> NestedFlag)
-> (OtherPacket -> OtherPacket -> NestedFlag) -> Eq OtherPacket
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: OtherPacket -> OtherPacket -> NestedFlag
== :: OtherPacket -> OtherPacket -> NestedFlag
$c/= :: OtherPacket -> OtherPacket -> NestedFlag
/= :: OtherPacket -> OtherPacket -> NestedFlag
Eq, Int -> OtherPacket -> String -> String
[OtherPacket] -> String -> String
OtherPacket -> String
(Int -> OtherPacket -> String -> String)
-> (OtherPacket -> String)
-> ([OtherPacket] -> String -> String)
-> Show OtherPacket
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> OtherPacket -> String -> String
showsPrec :: Int -> OtherPacket -> String -> String
$cshow :: OtherPacket -> String
show :: OtherPacket -> String
$cshowList :: [OtherPacket] -> String -> String
showList :: [OtherPacket] -> String -> String
Show, Typeable)
instance Packet OtherPacket where
data PacketType OtherPacket = OtherPacketType
deriving (Int -> PacketType OtherPacket -> String -> String
[PacketType OtherPacket] -> String -> String
PacketType OtherPacket -> String
(Int -> PacketType OtherPacket -> String -> String)
-> (PacketType OtherPacket -> String)
-> ([PacketType OtherPacket] -> String -> String)
-> Show (PacketType OtherPacket)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType OtherPacket -> String -> String
showsPrec :: Int -> PacketType OtherPacket -> String -> String
$cshow :: PacketType OtherPacket -> String
show :: PacketType OtherPacket -> String
$cshowList :: [PacketType OtherPacket] -> String -> String
showList :: [PacketType OtherPacket] -> String -> String
Show, PacketType OtherPacket -> PacketType OtherPacket -> NestedFlag
(PacketType OtherPacket -> PacketType OtherPacket -> NestedFlag)
-> (PacketType OtherPacket -> PacketType OtherPacket -> NestedFlag)
-> Eq (PacketType OtherPacket)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType OtherPacket -> PacketType OtherPacket -> NestedFlag
== :: PacketType OtherPacket -> PacketType OtherPacket -> NestedFlag
$c/= :: PacketType OtherPacket -> PacketType OtherPacket -> NestedFlag
/= :: PacketType OtherPacket -> PacketType OtherPacket -> NestedFlag
Eq)
packetType :: OtherPacket -> PacketType OtherPacket
packetType OtherPacket
_ = PacketType OtherPacket
OtherPacketType
packetCode :: PacketType OtherPacket -> PacketVersion
packetCode PacketType OtherPacket
_ = String -> PacketVersion
forall a. HasCallStack => String -> a
error String
"OtherPacket has no static packet type code"
dynamicPacketCode :: OtherPacket -> PacketVersion
dynamicPacketCode = OtherPacket -> PacketVersion
_otherPacketType
toPkt :: OtherPacket -> Pkt
toPkt (OtherPacket PacketVersion
a ByteString
b) = PacketVersion -> ByteString -> Pkt
OtherPacketPkt PacketVersion
a ByteString
b
fromPktEither :: Pkt -> Either String OtherPacket
fromPktEither (OtherPacketPkt PacketVersion
a ByteString
b) = OtherPacket -> Either String OtherPacket
forall a b. b -> Either a b
Right (PacketVersion -> ByteString -> OtherPacket
OtherPacket PacketVersion
a ByteString
b)
fromPktEither Pkt
pkt = String -> Pkt -> Either String OtherPacket
forall a. String -> Pkt -> Either String a
coercionError String
"OtherPacket" Pkt
pkt
instance Pretty OtherPacket where
pretty :: forall ann. OtherPacket -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann) -> (OtherPacket -> Pkt) -> OtherPacket -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OtherPacket -> Pkt
forall a. Packet a => a -> Pkt
toPkt
data BrokenPacket =
BrokenPacket
{ BrokenPacket -> String
_brokenPacketParseError :: String
, BrokenPacket -> PacketVersion
_brokenPacketType :: Word8
, BrokenPacket -> ByteString
_brokenPacketPayload :: ByteString
}
deriving (Typeable BrokenPacket
Typeable BrokenPacket =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BrokenPacket -> c BrokenPacket)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BrokenPacket)
-> (BrokenPacket -> Constr)
-> (BrokenPacket -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BrokenPacket))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BrokenPacket))
-> ((forall b. Data b => b -> b) -> BrokenPacket -> BrokenPacket)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BrokenPacket -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BrokenPacket -> r)
-> (forall u. (forall d. Data d => d -> u) -> BrokenPacket -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> BrokenPacket -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket)
-> Data BrokenPacket
BrokenPacket -> Constr
BrokenPacket -> DataType
(forall b. Data b => b -> b) -> BrokenPacket -> BrokenPacket
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> BrokenPacket -> u
forall u. (forall d. Data d => d -> u) -> BrokenPacket -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BrokenPacket -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BrokenPacket -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BrokenPacket
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BrokenPacket -> c BrokenPacket
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BrokenPacket)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BrokenPacket)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BrokenPacket -> c BrokenPacket
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> BrokenPacket -> c BrokenPacket
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BrokenPacket
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BrokenPacket
$ctoConstr :: BrokenPacket -> Constr
toConstr :: BrokenPacket -> Constr
$cdataTypeOf :: BrokenPacket -> DataType
dataTypeOf :: BrokenPacket -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BrokenPacket)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BrokenPacket)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BrokenPacket)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BrokenPacket)
$cgmapT :: (forall b. Data b => b -> b) -> BrokenPacket -> BrokenPacket
gmapT :: (forall b. Data b => b -> b) -> BrokenPacket -> BrokenPacket
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BrokenPacket -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> BrokenPacket -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BrokenPacket -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> BrokenPacket -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> BrokenPacket -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> BrokenPacket -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> BrokenPacket -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> BrokenPacket -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> BrokenPacket -> m BrokenPacket
Data, BrokenPacket -> BrokenPacket -> NestedFlag
(BrokenPacket -> BrokenPacket -> NestedFlag)
-> (BrokenPacket -> BrokenPacket -> NestedFlag) -> Eq BrokenPacket
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: BrokenPacket -> BrokenPacket -> NestedFlag
== :: BrokenPacket -> BrokenPacket -> NestedFlag
$c/= :: BrokenPacket -> BrokenPacket -> NestedFlag
/= :: BrokenPacket -> BrokenPacket -> NestedFlag
Eq, Int -> BrokenPacket -> String -> String
[BrokenPacket] -> String -> String
BrokenPacket -> String
(Int -> BrokenPacket -> String -> String)
-> (BrokenPacket -> String)
-> ([BrokenPacket] -> String -> String)
-> Show BrokenPacket
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> BrokenPacket -> String -> String
showsPrec :: Int -> BrokenPacket -> String -> String
$cshow :: BrokenPacket -> String
show :: BrokenPacket -> String
$cshowList :: [BrokenPacket] -> String -> String
showList :: [BrokenPacket] -> String -> String
Show, Typeable)
instance Packet BrokenPacket where
data PacketType BrokenPacket = BrokenPacketType
deriving (Int -> PacketType BrokenPacket -> String -> String
[PacketType BrokenPacket] -> String -> String
PacketType BrokenPacket -> String
(Int -> PacketType BrokenPacket -> String -> String)
-> (PacketType BrokenPacket -> String)
-> ([PacketType BrokenPacket] -> String -> String)
-> Show (PacketType BrokenPacket)
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
$cshowsPrec :: Int -> PacketType BrokenPacket -> String -> String
showsPrec :: Int -> PacketType BrokenPacket -> String -> String
$cshow :: PacketType BrokenPacket -> String
show :: PacketType BrokenPacket -> String
$cshowList :: [PacketType BrokenPacket] -> String -> String
showList :: [PacketType BrokenPacket] -> String -> String
Show, PacketType BrokenPacket -> PacketType BrokenPacket -> NestedFlag
(PacketType BrokenPacket -> PacketType BrokenPacket -> NestedFlag)
-> (PacketType BrokenPacket
-> PacketType BrokenPacket -> NestedFlag)
-> Eq (PacketType BrokenPacket)
forall a. (a -> a -> NestedFlag) -> (a -> a -> NestedFlag) -> Eq a
$c== :: PacketType BrokenPacket -> PacketType BrokenPacket -> NestedFlag
== :: PacketType BrokenPacket -> PacketType BrokenPacket -> NestedFlag
$c/= :: PacketType BrokenPacket -> PacketType BrokenPacket -> NestedFlag
/= :: PacketType BrokenPacket -> PacketType BrokenPacket -> NestedFlag
Eq)
packetType :: BrokenPacket -> PacketType BrokenPacket
packetType BrokenPacket
_ = PacketType BrokenPacket
BrokenPacketType
packetCode :: PacketType BrokenPacket -> PacketVersion
packetCode PacketType BrokenPacket
_ = String -> PacketVersion
forall a. HasCallStack => String -> a
error String
"BrokenPacket has no static packet type code"
dynamicPacketCode :: BrokenPacket -> PacketVersion
dynamicPacketCode = BrokenPacket -> PacketVersion
_brokenPacketType
toPkt :: BrokenPacket -> Pkt
toPkt (BrokenPacket String
a PacketVersion
b ByteString
c) = String -> PacketVersion -> ByteString -> Pkt
BrokenPacketPkt String
a PacketVersion
b ByteString
c
fromPktEither :: Pkt -> Either String BrokenPacket
fromPktEither (BrokenPacketPkt String
a PacketVersion
b ByteString
c) = BrokenPacket -> Either String BrokenPacket
forall a b. b -> Either a b
Right (String -> PacketVersion -> ByteString -> BrokenPacket
BrokenPacket String
a PacketVersion
b ByteString
c)
fromPktEither Pkt
pkt = String -> Pkt -> Either String BrokenPacket
forall a. String -> Pkt -> Either String a
coercionError String
"BrokenPacket" Pkt
pkt
instance Pretty BrokenPacket where
pretty :: forall ann. BrokenPacket -> Doc ann
pretty = Pkt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
forall ann. Pkt -> Doc ann
pretty (Pkt -> Doc ann)
-> (BrokenPacket -> Pkt) -> BrokenPacket -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BrokenPacket -> Pkt
forall a. Packet a => a -> Pkt
toPkt
$(makeLenses ''Signature)
$(makeLenses ''SecretKey)
$(makeLenses ''PublicKey)
$(makeLenses ''SecretSubkey)
$(makeLenses ''CompressedData)
$(makeLenses ''SymEncData)
$(makeLenses ''Marker)
$(makeLenses ''LiteralData)
$(makeLenses ''Trust)
$(makeLenses ''UserId)
$(makeLenses ''PublicSubkey)
$(makeLenses ''UserAttribute)
$(makeLenses ''SymEncIntegrityProtectedData)
$(makeLenses ''ModificationDetectionCode)
$(makeLenses ''OtherPacket)
$(makeLenses ''BrokenPacket)