{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Codec.Encryption.OpenPGP.Types.Internal.TK where
import GHC.Generics (Generic)
import Codec.Encryption.OpenPGP.Types.Internal.Base
import Codec.Encryption.OpenPGP.Types.Internal.PKITypes
import Codec.Encryption.OpenPGP.Types.Internal.Pkt
import Control.Arrow ((&&&))
import Data.Bifunctor (first)
import Control.Lens (makeLenses)
import qualified Data.Aeson.TH as ATH
import qualified Data.ByteString.Lazy as BL
import Data.Data (Data)
import Data.IxSet.Typed (IxSet)
import qualified Data.IxSet.Typed as IxSet
import Data.Kind (Type)
import Data.List (sortOn)
import qualified Data.List.NonEmpty as NE
import Data.Ord (comparing)
import Data.Text (Text)
import Data.Typeable (Typeable)
import Data.Word (Word8)
data PacketZipper =
PacketZipper
{ PacketZipper -> [PktWithWireRep]
_zpBefore :: [PktWithWireRep]
, PacketZipper -> PktWithWireRep
_zpCurrent :: PktWithWireRep
, PacketZipper -> [PktWithWireRep]
_zpAfter :: [PktWithWireRep]
}
deriving (Typeable PacketZipper
Typeable PacketZipper =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PacketZipper -> c PacketZipper)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PacketZipper)
-> (PacketZipper -> Constr)
-> (PacketZipper -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PacketZipper))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PacketZipper))
-> ((forall b. Data b => b -> b) -> PacketZipper -> PacketZipper)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PacketZipper -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PacketZipper -> r)
-> (forall u. (forall d. Data d => d -> u) -> PacketZipper -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> PacketZipper -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper)
-> Data PacketZipper
PacketZipper -> Constr
PacketZipper -> DataType
(forall b. Data b => b -> b) -> PacketZipper -> PacketZipper
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) -> PacketZipper -> u
forall u. (forall d. Data d => d -> u) -> PacketZipper -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PacketZipper -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PacketZipper -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PacketZipper
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PacketZipper -> c PacketZipper
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PacketZipper)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PacketZipper)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PacketZipper -> c PacketZipper
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PacketZipper -> c PacketZipper
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PacketZipper
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PacketZipper
$ctoConstr :: PacketZipper -> Constr
toConstr :: PacketZipper -> Constr
$cdataTypeOf :: PacketZipper -> DataType
dataTypeOf :: PacketZipper -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PacketZipper)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PacketZipper)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PacketZipper)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PacketZipper)
$cgmapT :: (forall b. Data b => b -> b) -> PacketZipper -> PacketZipper
gmapT :: (forall b. Data b => b -> b) -> PacketZipper -> PacketZipper
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PacketZipper -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PacketZipper -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PacketZipper -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PacketZipper -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PacketZipper -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> PacketZipper -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PacketZipper -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PacketZipper -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketZipper -> m PacketZipper
Data, PacketZipper -> PacketZipper -> Bool
(PacketZipper -> PacketZipper -> Bool)
-> (PacketZipper -> PacketZipper -> Bool) -> Eq PacketZipper
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PacketZipper -> PacketZipper -> Bool
== :: PacketZipper -> PacketZipper -> Bool
$c/= :: PacketZipper -> PacketZipper -> Bool
/= :: PacketZipper -> PacketZipper -> Bool
Eq, (forall x. PacketZipper -> Rep PacketZipper x)
-> (forall x. Rep PacketZipper x -> PacketZipper)
-> Generic PacketZipper
forall x. Rep PacketZipper x -> PacketZipper
forall x. PacketZipper -> Rep PacketZipper x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PacketZipper -> Rep PacketZipper x
from :: forall x. PacketZipper -> Rep PacketZipper x
$cto :: forall x. Rep PacketZipper x -> PacketZipper
to :: forall x. Rep PacketZipper x -> PacketZipper
Generic, Eq PacketZipper
Eq PacketZipper =>
(PacketZipper -> PacketZipper -> Ordering)
-> (PacketZipper -> PacketZipper -> Bool)
-> (PacketZipper -> PacketZipper -> Bool)
-> (PacketZipper -> PacketZipper -> Bool)
-> (PacketZipper -> PacketZipper -> Bool)
-> (PacketZipper -> PacketZipper -> PacketZipper)
-> (PacketZipper -> PacketZipper -> PacketZipper)
-> Ord PacketZipper
PacketZipper -> PacketZipper -> Bool
PacketZipper -> PacketZipper -> Ordering
PacketZipper -> PacketZipper -> PacketZipper
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PacketZipper -> PacketZipper -> Ordering
compare :: PacketZipper -> PacketZipper -> Ordering
$c< :: PacketZipper -> PacketZipper -> Bool
< :: PacketZipper -> PacketZipper -> Bool
$c<= :: PacketZipper -> PacketZipper -> Bool
<= :: PacketZipper -> PacketZipper -> Bool
$c> :: PacketZipper -> PacketZipper -> Bool
> :: PacketZipper -> PacketZipper -> Bool
$c>= :: PacketZipper -> PacketZipper -> Bool
>= :: PacketZipper -> PacketZipper -> Bool
$cmax :: PacketZipper -> PacketZipper -> PacketZipper
max :: PacketZipper -> PacketZipper -> PacketZipper
$cmin :: PacketZipper -> PacketZipper -> PacketZipper
min :: PacketZipper -> PacketZipper -> PacketZipper
Ord, Int -> PacketZipper -> ShowS
[PacketZipper] -> ShowS
PacketZipper -> String
(Int -> PacketZipper -> ShowS)
-> (PacketZipper -> String)
-> ([PacketZipper] -> ShowS)
-> Show PacketZipper
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PacketZipper -> ShowS
showsPrec :: Int -> PacketZipper -> ShowS
$cshow :: PacketZipper -> String
show :: PacketZipper -> String
$cshowList :: [PacketZipper] -> ShowS
showList :: [PacketZipper] -> ShowS
Show, Typeable)
zFromList :: [PktWithWireRep] -> Maybe PacketZipper
zFromList :: [PktWithWireRep] -> Maybe PacketZipper
zFromList [] = Maybe PacketZipper
forall a. Maybe a
Nothing
zFromList (PktWithWireRep
x:[PktWithWireRep]
xs) = PacketZipper -> Maybe PacketZipper
forall a. a -> Maybe a
Just ([PktWithWireRep]
-> PktWithWireRep -> [PktWithWireRep] -> PacketZipper
PacketZipper [] PktWithWireRep
x [PktWithWireRep]
xs)
zPosition :: PacketZipper -> Int
zPosition :: PacketZipper -> Int
zPosition (PacketZipper [PktWithWireRep]
before PktWithWireRep
_ [PktWithWireRep]
_) = [PktWithWireRep] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [PktWithWireRep]
before
zMoveNext :: PacketZipper -> Maybe PacketZipper
zMoveNext :: PacketZipper -> Maybe PacketZipper
zMoveNext (PacketZipper [PktWithWireRep]
before PktWithWireRep
current []) = Maybe PacketZipper
forall a. Maybe a
Nothing
zMoveNext (PacketZipper [PktWithWireRep]
before PktWithWireRep
current (PktWithWireRep
x:[PktWithWireRep]
xs)) =
PacketZipper -> Maybe PacketZipper
forall a. a -> Maybe a
Just ([PktWithWireRep]
-> PktWithWireRep -> [PktWithWireRep] -> PacketZipper
PacketZipper ([PktWithWireRep]
before [PktWithWireRep] -> [PktWithWireRep] -> [PktWithWireRep]
forall a. [a] -> [a] -> [a]
++ [PktWithWireRep
current]) PktWithWireRep
x [PktWithWireRep]
xs)
zRemaining :: PacketZipper -> [PktWithWireRep]
zRemaining :: PacketZipper -> [PktWithWireRep]
zRemaining (PacketZipper [PktWithWireRep]
_ PktWithWireRep
current [PktWithWireRep]
after) = PktWithWireRep
current PktWithWireRep -> [PktWithWireRep] -> [PktWithWireRep]
forall a. a -> [a] -> [a]
: [PktWithWireRep]
after
zToList :: PacketZipper -> [PktWithWireRep]
zToList :: PacketZipper -> [PktWithWireRep]
zToList (PacketZipper [PktWithWireRep]
before PktWithWireRep
current [PktWithWireRep]
after) = [PktWithWireRep]
before [PktWithWireRep] -> [PktWithWireRep] -> [PktWithWireRep]
forall a. [a] -> [a] -> [a]
++ [PktWithWireRep
current] [PktWithWireRep] -> [PktWithWireRep] -> [PktWithWireRep]
forall a. [a] -> [a] -> [a]
++ [PktWithWireRep]
after
data TKUnknown =
TKUnknown
{ TKUnknown -> (SomePKPayload, Maybe SKAddendum)
_tkuKey :: (SomePKPayload, Maybe SKAddendum)
, TKUnknown -> [SignaturePayload]
_tkuRevs :: [SignaturePayload]
, TKUnknown -> [(Text, [SignaturePayload])]
_tkuUIDs :: [(Text, [SignaturePayload])]
, TKUnknown -> [([UserAttrSubPacket], [SignaturePayload])]
_tkuUAts :: [([UserAttrSubPacket], [SignaturePayload])]
, TKUnknown -> [(Pkt, [SignaturePayload])]
_tkuSubs :: [(Pkt, [SignaturePayload])]
}
deriving (Typeable TKUnknown
Typeable TKUnknown =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKUnknown -> c TKUnknown)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKUnknown)
-> (TKUnknown -> Constr)
-> (TKUnknown -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKUnknown))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TKUnknown))
-> ((forall b. Data b => b -> b) -> TKUnknown -> TKUnknown)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TKUnknown -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TKUnknown -> r)
-> (forall u. (forall d. Data d => d -> u) -> TKUnknown -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> TKUnknown -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown)
-> Data TKUnknown
TKUnknown -> Constr
TKUnknown -> DataType
(forall b. Data b => b -> b) -> TKUnknown -> TKUnknown
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) -> TKUnknown -> u
forall u. (forall d. Data d => d -> u) -> TKUnknown -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TKUnknown -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TKUnknown -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKUnknown
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKUnknown -> c TKUnknown
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKUnknown)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TKUnknown)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKUnknown -> c TKUnknown
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKUnknown -> c TKUnknown
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKUnknown
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKUnknown
$ctoConstr :: TKUnknown -> Constr
toConstr :: TKUnknown -> Constr
$cdataTypeOf :: TKUnknown -> DataType
dataTypeOf :: TKUnknown -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKUnknown)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKUnknown)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TKUnknown)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TKUnknown)
$cgmapT :: (forall b. Data b => b -> b) -> TKUnknown -> TKUnknown
gmapT :: (forall b. Data b => b -> b) -> TKUnknown -> TKUnknown
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TKUnknown -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TKUnknown -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TKUnknown -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TKUnknown -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TKUnknown -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> TKUnknown -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TKUnknown -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TKUnknown -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKUnknown -> m TKUnknown
Data, TKUnknown -> TKUnknown -> Bool
(TKUnknown -> TKUnknown -> Bool)
-> (TKUnknown -> TKUnknown -> Bool) -> Eq TKUnknown
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TKUnknown -> TKUnknown -> Bool
== :: TKUnknown -> TKUnknown -> Bool
$c/= :: TKUnknown -> TKUnknown -> Bool
/= :: TKUnknown -> TKUnknown -> Bool
Eq, (forall x. TKUnknown -> Rep TKUnknown x)
-> (forall x. Rep TKUnknown x -> TKUnknown) -> Generic TKUnknown
forall x. Rep TKUnknown x -> TKUnknown
forall x. TKUnknown -> Rep TKUnknown x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TKUnknown -> Rep TKUnknown x
from :: forall x. TKUnknown -> Rep TKUnknown x
$cto :: forall x. Rep TKUnknown x -> TKUnknown
to :: forall x. Rep TKUnknown x -> TKUnknown
Generic, Int -> TKUnknown -> ShowS
[TKUnknown] -> ShowS
TKUnknown -> String
(Int -> TKUnknown -> ShowS)
-> (TKUnknown -> String)
-> ([TKUnknown] -> ShowS)
-> Show TKUnknown
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TKUnknown -> ShowS
showsPrec :: Int -> TKUnknown -> ShowS
$cshow :: TKUnknown -> String
show :: TKUnknown -> String
$cshowList :: [TKUnknown] -> ShowS
showList :: [TKUnknown] -> ShowS
Show, Typeable)
data TKKind
= PublicTK
| SecretTK
deriving (Typeable TKKind
Typeable TKKind =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKKind -> c TKKind)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKKind)
-> (TKKind -> Constr)
-> (TKKind -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKKind))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TKKind))
-> ((forall b. Data b => b -> b) -> TKKind -> TKKind)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TKKind -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TKKind -> r)
-> (forall u. (forall d. Data d => d -> u) -> TKKind -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> TKKind -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind)
-> Data TKKind
TKKind -> Constr
TKKind -> DataType
(forall b. Data b => b -> b) -> TKKind -> TKKind
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) -> TKKind -> u
forall u. (forall d. Data d => d -> u) -> TKKind -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TKKind -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TKKind -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKKind
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKKind -> c TKKind
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKKind)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TKKind)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKKind -> c TKKind
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKKind -> c TKKind
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKKind
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKKind
$ctoConstr :: TKKind -> Constr
toConstr :: TKKind -> Constr
$cdataTypeOf :: TKKind -> DataType
dataTypeOf :: TKKind -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKKind)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKKind)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TKKind)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TKKind)
$cgmapT :: (forall b. Data b => b -> b) -> TKKind -> TKKind
gmapT :: (forall b. Data b => b -> b) -> TKKind -> TKKind
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TKKind -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TKKind -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TKKind -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TKKind -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TKKind -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> TKKind -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TKKind -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TKKind -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKKind -> m TKKind
Data, TKKind -> TKKind -> Bool
(TKKind -> TKKind -> Bool)
-> (TKKind -> TKKind -> Bool) -> Eq TKKind
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TKKind -> TKKind -> Bool
== :: TKKind -> TKKind -> Bool
$c/= :: TKKind -> TKKind -> Bool
/= :: TKKind -> TKKind -> Bool
Eq, (forall x. TKKind -> Rep TKKind x)
-> (forall x. Rep TKKind x -> TKKind) -> Generic TKKind
forall x. Rep TKKind x -> TKKind
forall x. TKKind -> Rep TKKind x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TKKind -> Rep TKKind x
from :: forall x. TKKind -> Rep TKKind x
$cto :: forall x. Rep TKKind x -> TKKind
to :: forall x. Rep TKKind x -> TKKind
Generic, Eq TKKind
Eq TKKind =>
(TKKind -> TKKind -> Ordering)
-> (TKKind -> TKKind -> Bool)
-> (TKKind -> TKKind -> Bool)
-> (TKKind -> TKKind -> Bool)
-> (TKKind -> TKKind -> Bool)
-> (TKKind -> TKKind -> TKKind)
-> (TKKind -> TKKind -> TKKind)
-> Ord TKKind
TKKind -> TKKind -> Bool
TKKind -> TKKind -> Ordering
TKKind -> TKKind -> TKKind
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TKKind -> TKKind -> Ordering
compare :: TKKind -> TKKind -> Ordering
$c< :: TKKind -> TKKind -> Bool
< :: TKKind -> TKKind -> Bool
$c<= :: TKKind -> TKKind -> Bool
<= :: TKKind -> TKKind -> Bool
$c> :: TKKind -> TKKind -> Bool
> :: TKKind -> TKKind -> Bool
$c>= :: TKKind -> TKKind -> Bool
>= :: TKKind -> TKKind -> Bool
$cmax :: TKKind -> TKKind -> TKKind
max :: TKKind -> TKKind -> TKKind
$cmin :: TKKind -> TKKind -> TKKind
min :: TKKind -> TKKind -> TKKind
Ord, Int -> TKKind -> ShowS
[TKKind] -> ShowS
TKKind -> String
(Int -> TKKind -> ShowS)
-> (TKKind -> String) -> ([TKKind] -> ShowS) -> Show TKKind
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TKKind -> ShowS
showsPrec :: Int -> TKKind -> ShowS
$cshow :: TKKind -> String
show :: TKKind -> String
$cshowList :: [TKKind] -> ShowS
showList :: [TKKind] -> ShowS
Show, Typeable)
type family TKKindToKeyPktKind (k :: TKKind) :: KeyPktKind where
TKKindToKeyPktKind 'PublicTK = 'PublicPkt
TKKindToKeyPktKind 'SecretTK = 'SecretPkt
data TK (k :: TKKind) =
TK
{ forall (k :: TKKind). TK k -> KeyPkt (TKKindToKeyPktKind k)
_tkPrimaryKey :: KeyPkt (TKKindToKeyPktKind k)
, forall (k :: TKKind). TK k -> [SignaturePayload]
_tkRevs :: [SignaturePayload]
, forall (k :: TKKind). TK k -> [(Text, [SignaturePayload])]
_tkUIDs :: [(Text, [SignaturePayload])]
, forall (k :: TKKind).
TK k -> [([UserAttrSubPacket], [SignaturePayload])]
_tkUAts :: [([UserAttrSubPacket], [SignaturePayload])]
, forall (k :: TKKind).
TK k -> [(KeyPkt (TKKindToKeyPktKind k), [SignaturePayload])]
_tkSubs :: [(KeyPkt (TKKindToKeyPktKind k), [SignaturePayload])]
}
deriving (TK k -> TK k -> Bool
(TK k -> TK k -> Bool) -> (TK k -> TK k -> Bool) -> Eq (TK k)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (k :: TKKind). TK k -> TK k -> Bool
$c== :: forall (k :: TKKind). TK k -> TK k -> Bool
== :: TK k -> TK k -> Bool
$c/= :: forall (k :: TKKind). TK k -> TK k -> Bool
/= :: TK k -> TK k -> Bool
Eq, Int -> TK k -> ShowS
[TK k] -> ShowS
TK k -> String
(Int -> TK k -> ShowS)
-> (TK k -> String) -> ([TK k] -> ShowS) -> Show (TK k)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (k :: TKKind). Int -> TK k -> ShowS
forall (k :: TKKind). [TK k] -> ShowS
forall (k :: TKKind). TK k -> String
$cshowsPrec :: forall (k :: TKKind). Int -> TK k -> ShowS
showsPrec :: Int -> TK k -> ShowS
$cshow :: forall (k :: TKKind). TK k -> String
show :: TK k -> String
$cshowList :: forall (k :: TKKind). [TK k] -> ShowS
showList :: [TK k] -> ShowS
Show)
deriving instance (Typeable k, Data (KeyPkt (TKKindToKeyPktKind k))) => Data (TK k)
instance Ord (TK k) where
compare :: TK k -> TK k -> Ordering
compare = (TK k -> KeyPkt (TKKindToKeyPktKind k)) -> TK k -> TK k -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing TK k -> KeyPkt (TKKindToKeyPktKind k)
forall (k :: TKKind). TK k -> KeyPkt (TKKindToKeyPktKind k)
_tkPrimaryKey
data SomeTK where
SomePublicTK :: TK 'PublicTK -> SomeTK
SomeSecretTK :: TK 'SecretTK -> SomeTK
deriving instance Show SomeTK
instance Eq SomeTK where
SomeTK
left == :: SomeTK -> SomeTK -> Bool
== SomeTK
right = SomeTK -> TKUnknown
someTKToUnknown SomeTK
left TKUnknown -> TKUnknown -> Bool
forall a. Eq a => a -> a -> Bool
== SomeTK -> TKUnknown
someTKToUnknown SomeTK
right
data TKConversionError
= PublicSubkeyHasPrimaryRole
| SecretSubkeyHasPrimaryRole
| ExpectedPublicSubkeyPacket Word8
| ExpectedSecretSubkeyPacket Word8
deriving (TKConversionError -> TKConversionError -> Bool
(TKConversionError -> TKConversionError -> Bool)
-> (TKConversionError -> TKConversionError -> Bool)
-> Eq TKConversionError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TKConversionError -> TKConversionError -> Bool
== :: TKConversionError -> TKConversionError -> Bool
$c/= :: TKConversionError -> TKConversionError -> Bool
/= :: TKConversionError -> TKConversionError -> Bool
Eq, Int -> TKConversionError -> ShowS
[TKConversionError] -> ShowS
TKConversionError -> String
(Int -> TKConversionError -> ShowS)
-> (TKConversionError -> String)
-> ([TKConversionError] -> ShowS)
-> Show TKConversionError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TKConversionError -> ShowS
showsPrec :: Int -> TKConversionError -> ShowS
$cshow :: TKConversionError -> String
show :: TKConversionError -> String
$cshowList :: [TKConversionError] -> ShowS
showList :: [TKConversionError] -> ShowS
Show)
renderTKConversionError :: TKConversionError -> String
renderTKConversionError :: TKConversionError -> String
renderTKConversionError TKConversionError
PublicSubkeyHasPrimaryRole = String
"public subkey has primary-key role"
renderTKConversionError TKConversionError
SecretSubkeyHasPrimaryRole = String
"secret subkey has primary-key role"
renderTKConversionError (ExpectedPublicSubkeyPacket Word8
tagValue) =
String
"expected public subkey, got packet tag " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Word8 -> String
forall a. Show a => a -> String
show Word8
tagValue
renderTKConversionError (ExpectedSecretSubkeyPacket Word8
tagValue) =
String
"expected secret subkey, got packet tag " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Word8 -> String
forall a. Show a => a -> String
show Word8
tagValue
tkToUnknown :: TK k -> TKUnknown
tkToUnknown :: forall (k :: TKKind). TK k -> TKUnknown
tkToUnknown TK k
tk =
TKUnknown
{ _tkuKey :: (SomePKPayload, Maybe SKAddendum)
_tkuKey = KeyPkt (TKKindToKeyPktKind k) -> (SomePKPayload, Maybe SKAddendum)
forall (k :: KeyPktKind).
KeyPkt k -> (SomePKPayload, Maybe SKAddendum)
keyPktTKKey (TK k -> KeyPkt (TKKindToKeyPktKind k)
forall (k :: TKKind). TK k -> KeyPkt (TKKindToKeyPktKind k)
_tkPrimaryKey TK k
tk)
, _tkuRevs :: [SignaturePayload]
_tkuRevs = TK k -> [SignaturePayload]
forall (k :: TKKind). TK k -> [SignaturePayload]
_tkRevs TK k
tk
, _tkuUIDs :: [(Text, [SignaturePayload])]
_tkuUIDs = TK k -> [(Text, [SignaturePayload])]
forall (k :: TKKind). TK k -> [(Text, [SignaturePayload])]
_tkUIDs TK k
tk
, _tkuUAts :: [([UserAttrSubPacket], [SignaturePayload])]
_tkuUAts = TK k -> [([UserAttrSubPacket], [SignaturePayload])]
forall (k :: TKKind).
TK k -> [([UserAttrSubPacket], [SignaturePayload])]
_tkUAts TK k
tk
, _tkuSubs :: [(Pkt, [SignaturePayload])]
_tkuSubs = ((KeyPkt (TKKindToKeyPktKind k), [SignaturePayload])
-> (Pkt, [SignaturePayload]))
-> [(KeyPkt (TKKindToKeyPktKind k), [SignaturePayload])]
-> [(Pkt, [SignaturePayload])]
forall a b. (a -> b) -> [a] -> [b]
map (\(KeyPkt (TKKindToKeyPktKind k)
kp, [SignaturePayload]
sigs) -> (KeyPkt (TKKindToKeyPktKind k) -> Pkt
forall (k :: KeyPktKind). KeyPkt k -> Pkt
keyPktToPkt KeyPkt (TKKindToKeyPktKind k)
kp, [SignaturePayload]
sigs)) (TK k -> [(KeyPkt (TKKindToKeyPktKind k), [SignaturePayload])]
forall (k :: TKKind).
TK k -> [(KeyPkt (TKKindToKeyPktKind k), [SignaturePayload])]
_tkSubs TK k
tk)
}
someTKToUnknown :: SomeTK -> TKUnknown
someTKToUnknown :: SomeTK -> TKUnknown
someTKToUnknown (SomePublicTK TK 'PublicTK
tk) = TK 'PublicTK -> TKUnknown
forall (k :: TKKind). TK k -> TKUnknown
tkToUnknown TK 'PublicTK
tk
someTKToUnknown (SomeSecretTK TK 'SecretTK
tk) = TK 'SecretTK -> TKUnknown
forall (k :: TKKind). TK k -> TKUnknown
tkToUnknown TK 'SecretTK
tk
mkTKUnknown :: SomePKPayload -> Maybe SKAddendum -> TKUnknown
mkTKUnknown :: SomePKPayload -> Maybe SKAddendum -> TKUnknown
mkTKUnknown SomePKPayload
pkp Maybe SKAddendum
maybeSka =
TKUnknown
{ _tkuKey :: (SomePKPayload, Maybe SKAddendum)
_tkuKey = (SomePKPayload
pkp, Maybe SKAddendum
maybeSka)
, _tkuRevs :: [SignaturePayload]
_tkuRevs = []
, _tkuUIDs :: [(Text, [SignaturePayload])]
_tkuUIDs = []
, _tkuUAts :: [([UserAttrSubPacket], [SignaturePayload])]
_tkuUAts = []
, _tkuSubs :: [(Pkt, [SignaturePayload])]
_tkuSubs = []
}
fromPrimaryKeyPktToTKUnknown :: Pkt -> Either String TKUnknown
fromPrimaryKeyPktToTKUnknown :: Pkt -> Either String TKUnknown
fromPrimaryKeyPktToTKUnknown (PublicKeyPkt SomePKPayload
pkp) =
TKUnknown -> Either String TKUnknown
forall a b. b -> Either a b
Right (SomePKPayload -> Maybe SKAddendum -> TKUnknown
mkTKUnknown SomePKPayload
pkp Maybe SKAddendum
forall a. Maybe a
Nothing)
fromPrimaryKeyPktToTKUnknown (SecretKeyPkt SomePKPayload
pkp SKAddendum
ska) =
TKUnknown -> Either String TKUnknown
forall a b. b -> Either a b
Right (SomePKPayload -> Maybe SKAddendum -> TKUnknown
mkTKUnknown SomePKPayload
pkp (SKAddendum -> Maybe SKAddendum
forall a. a -> Maybe a
Just SKAddendum
ska))
fromPrimaryKeyPktToTKUnknown Pkt
pkt =
String -> Either String TKUnknown
forall a b. a -> Either a b
Left (String
"expected primary key packet, got packet tag " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Word8 -> String
forall a. Show a => a -> String
show (Pkt -> Word8
pktTag Pkt
pkt))
someTKToPublicTK :: SomeTK -> Maybe (TK 'PublicTK)
someTKToPublicTK :: SomeTK -> Maybe (TK 'PublicTK)
someTKToPublicTK (SomePublicTK TK 'PublicTK
tk) = TK 'PublicTK -> Maybe (TK 'PublicTK)
forall a. a -> Maybe a
Just TK 'PublicTK
tk
someTKToPublicTK (SomeSecretTK TK 'SecretTK
_) = Maybe (TK 'PublicTK)
forall a. Maybe a
Nothing
someTKToSecretTK :: SomeTK -> Maybe (TK 'SecretTK)
someTKToSecretTK :: SomeTK -> Maybe (TK 'SecretTK)
someTKToSecretTK (SomeSecretTK TK 'SecretTK
tk) = TK 'SecretTK -> Maybe (TK 'SecretTK)
forall a. a -> Maybe a
Just TK 'SecretTK
tk
someTKToSecretTK (SomePublicTK TK 'PublicTK
_) = Maybe (TK 'SecretTK)
forall a. Maybe a
Nothing
someTKToPublicViewTK :: SomeTK -> TK 'PublicTK
someTKToPublicViewTK :: SomeTK -> TK 'PublicTK
someTKToPublicViewTK (SomePublicTK TK 'PublicTK
tk) = TK 'PublicTK
tk
someTKToPublicViewTK (SomeSecretTK TK 'SecretTK
tk) = TK 'SecretTK -> TK 'PublicTK
publicViewTK TK 'SecretTK
tk
publicViewTK :: TK 'SecretTK -> TK 'PublicTK
publicViewTK :: TK 'SecretTK -> TK 'PublicTK
publicViewTK TK 'SecretTK
tk =
TK
{ _tkPrimaryKey :: KeyPkt (TKKindToKeyPktKind 'PublicTK)
_tkPrimaryKey = KeyPkt 'SecretPkt -> KeyPkt 'PublicPkt
keyPktToPublicView (TK 'SecretTK -> KeyPkt (TKKindToKeyPktKind 'SecretTK)
forall (k :: TKKind). TK k -> KeyPkt (TKKindToKeyPktKind k)
_tkPrimaryKey TK 'SecretTK
tk)
, _tkRevs :: [SignaturePayload]
_tkRevs = TK 'SecretTK -> [SignaturePayload]
forall (k :: TKKind). TK k -> [SignaturePayload]
_tkRevs TK 'SecretTK
tk
, _tkUIDs :: [(Text, [SignaturePayload])]
_tkUIDs = TK 'SecretTK -> [(Text, [SignaturePayload])]
forall (k :: TKKind). TK k -> [(Text, [SignaturePayload])]
_tkUIDs TK 'SecretTK
tk
, _tkUAts :: [([UserAttrSubPacket], [SignaturePayload])]
_tkUAts = TK 'SecretTK -> [([UserAttrSubPacket], [SignaturePayload])]
forall (k :: TKKind).
TK k -> [([UserAttrSubPacket], [SignaturePayload])]
_tkUAts TK 'SecretTK
tk
, _tkSubs :: [(KeyPkt (TKKindToKeyPktKind 'PublicTK), [SignaturePayload])]
_tkSubs = ((KeyPkt 'SecretPkt, [SignaturePayload])
-> (KeyPkt 'PublicPkt, [SignaturePayload]))
-> [(KeyPkt 'SecretPkt, [SignaturePayload])]
-> [(KeyPkt 'PublicPkt, [SignaturePayload])]
forall a b. (a -> b) -> [a] -> [b]
map (\(KeyPkt 'SecretPkt
kp, [SignaturePayload]
sigs) -> (KeyPkt 'SecretPkt -> KeyPkt 'PublicPkt
keyPktToPublicView KeyPkt 'SecretPkt
kp, [SignaturePayload]
sigs)) (TK 'SecretTK
-> [(KeyPkt (TKKindToKeyPktKind 'SecretTK), [SignaturePayload])]
forall (k :: TKKind).
TK k -> [(KeyPkt (TKKindToKeyPktKind k), [SignaturePayload])]
_tkSubs TK 'SecretTK
tk)
}
fromUnknownToTKEither :: TKUnknown -> Either TKConversionError SomeTK
fromUnknownToTKEither :: TKUnknown -> Either TKConversionError SomeTK
fromUnknownToTKEither TKUnknown
tk =
case TKUnknown -> (SomePKPayload, Maybe SKAddendum)
_tkuKey TKUnknown
tk of
(SomePKPayload
pkp, Maybe SKAddendum
Nothing) -> do
subs <- ((Pkt, [SignaturePayload])
-> Either
TKConversionError (KeyPkt 'PublicPkt, [SignaturePayload]))
-> [(Pkt, [SignaturePayload])]
-> Either
TKConversionError [(KeyPkt 'PublicPkt, [SignaturePayload])]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (Pkt, [SignaturePayload])
-> Either TKConversionError (KeyPkt 'PublicPkt, [SignaturePayload])
liftPublicSubkey (TKUnknown -> [(Pkt, [SignaturePayload])]
_tkuSubs TKUnknown
tk)
let typed :: TK 'PublicTK
typed =
TK
{ _tkPrimaryKey :: KeyPkt (TKKindToKeyPktKind 'PublicTK)
_tkPrimaryKey = SomePKPayload -> KeyPkt 'PublicPkt
KeyPktPublicPrimary SomePKPayload
pkp
, _tkRevs :: [SignaturePayload]
_tkRevs = TKUnknown -> [SignaturePayload]
_tkuRevs TKUnknown
tk
, _tkUIDs :: [(Text, [SignaturePayload])]
_tkUIDs = TKUnknown -> [(Text, [SignaturePayload])]
_tkuUIDs TKUnknown
tk
, _tkUAts :: [([UserAttrSubPacket], [SignaturePayload])]
_tkUAts = TKUnknown -> [([UserAttrSubPacket], [SignaturePayload])]
_tkuUAts TKUnknown
tk
, _tkSubs :: [(KeyPkt (TKKindToKeyPktKind 'PublicTK), [SignaturePayload])]
_tkSubs = [(KeyPkt 'PublicPkt, [SignaturePayload])]
[(KeyPkt (TKKindToKeyPktKind 'PublicTK), [SignaturePayload])]
subs
}
Right
(SomePublicTK typed)
(SomePKPayload
pkp, Just SKAddendum
ska) -> do
subs <- ((Pkt, [SignaturePayload])
-> Either
TKConversionError (KeyPkt 'SecretPkt, [SignaturePayload]))
-> [(Pkt, [SignaturePayload])]
-> Either
TKConversionError [(KeyPkt 'SecretPkt, [SignaturePayload])]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (Pkt, [SignaturePayload])
-> Either TKConversionError (KeyPkt 'SecretPkt, [SignaturePayload])
liftSecretSubkey (TKUnknown -> [(Pkt, [SignaturePayload])]
_tkuSubs TKUnknown
tk)
let typed :: TK 'SecretTK
typed =
TK
{ _tkPrimaryKey :: KeyPkt (TKKindToKeyPktKind 'SecretTK)
_tkPrimaryKey = SomePKPayload -> SKAddendum -> KeyPkt 'SecretPkt
KeyPktSecretPrimary SomePKPayload
pkp SKAddendum
ska
, _tkRevs :: [SignaturePayload]
_tkRevs = TKUnknown -> [SignaturePayload]
_tkuRevs TKUnknown
tk
, _tkUIDs :: [(Text, [SignaturePayload])]
_tkUIDs = TKUnknown -> [(Text, [SignaturePayload])]
_tkuUIDs TKUnknown
tk
, _tkUAts :: [([UserAttrSubPacket], [SignaturePayload])]
_tkUAts = TKUnknown -> [([UserAttrSubPacket], [SignaturePayload])]
_tkuUAts TKUnknown
tk
, _tkSubs :: [(KeyPkt (TKKindToKeyPktKind 'SecretTK), [SignaturePayload])]
_tkSubs = [(KeyPkt 'SecretPkt, [SignaturePayload])]
[(KeyPkt (TKKindToKeyPktKind 'SecretTK), [SignaturePayload])]
subs
}
Right
(SomeSecretTK typed)
where
liftPublicSubkey ::
(Pkt, [SignaturePayload])
-> Either TKConversionError (KeyPkt 'PublicPkt, [SignaturePayload])
liftPublicSubkey :: (Pkt, [SignaturePayload])
-> Either TKConversionError (KeyPkt 'PublicPkt, [SignaturePayload])
liftPublicSubkey (Pkt
pkt, [SignaturePayload]
sigs) =
case Pkt -> Maybe (KeyPkt 'PublicPkt)
pktToPublicKeyPkt Pkt
pkt of
Just KeyPkt 'PublicPkt
keyPkt
| KeyPkt 'PublicPkt -> KeyPktRole
forall (k :: KeyPktKind). KeyPkt k -> KeyPktRole
keyPktRole KeyPkt 'PublicPkt
keyPkt KeyPktRole -> KeyPktRole -> Bool
forall a. Eq a => a -> a -> Bool
== KeyPktRole
KeyPktSubkey ->
(KeyPkt 'PublicPkt, [SignaturePayload])
-> Either TKConversionError (KeyPkt 'PublicPkt, [SignaturePayload])
forall a b. b -> Either a b
Right (KeyPkt 'PublicPkt
keyPkt, [SignaturePayload]
sigs)
| Bool
otherwise ->
TKConversionError
-> Either TKConversionError (KeyPkt 'PublicPkt, [SignaturePayload])
forall a b. a -> Either a b
Left TKConversionError
PublicSubkeyHasPrimaryRole
Maybe (KeyPkt 'PublicPkt)
Nothing ->
TKConversionError
-> Either TKConversionError (KeyPkt 'PublicPkt, [SignaturePayload])
forall a b. a -> Either a b
Left (Word8 -> TKConversionError
ExpectedPublicSubkeyPacket (Pkt -> Word8
pktTag Pkt
pkt))
liftSecretSubkey ::
(Pkt, [SignaturePayload])
-> Either TKConversionError (KeyPkt 'SecretPkt, [SignaturePayload])
liftSecretSubkey :: (Pkt, [SignaturePayload])
-> Either TKConversionError (KeyPkt 'SecretPkt, [SignaturePayload])
liftSecretSubkey (Pkt
pkt, [SignaturePayload]
sigs) =
case Pkt -> Maybe (KeyPkt 'SecretPkt)
pktToSecretKeyPkt Pkt
pkt of
Just KeyPkt 'SecretPkt
keyPkt
| KeyPkt 'SecretPkt -> KeyPktRole
forall (k :: KeyPktKind). KeyPkt k -> KeyPktRole
keyPktRole KeyPkt 'SecretPkt
keyPkt KeyPktRole -> KeyPktRole -> Bool
forall a. Eq a => a -> a -> Bool
== KeyPktRole
KeyPktSubkey ->
(KeyPkt 'SecretPkt, [SignaturePayload])
-> Either TKConversionError (KeyPkt 'SecretPkt, [SignaturePayload])
forall a b. b -> Either a b
Right (KeyPkt 'SecretPkt
keyPkt, [SignaturePayload]
sigs)
| Bool
otherwise ->
TKConversionError
-> Either TKConversionError (KeyPkt 'SecretPkt, [SignaturePayload])
forall a b. a -> Either a b
Left TKConversionError
SecretSubkeyHasPrimaryRole
Maybe (KeyPkt 'SecretPkt)
Nothing ->
TKConversionError
-> Either TKConversionError (KeyPkt 'SecretPkt, [SignaturePayload])
forall a b. a -> Either a b
Left (Word8 -> TKConversionError
ExpectedSecretSubkeyPacket (Pkt -> Word8
pktTag Pkt
pkt))
fromUnknownToTK :: TKUnknown -> Either String SomeTK
fromUnknownToTK :: TKUnknown -> Either String SomeTK
fromUnknownToTK = (TKConversionError -> String)
-> Either TKConversionError SomeTK -> Either String SomeTK
forall a b c. (a -> b) -> Either a c -> Either b c
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first TKConversionError -> String
renderTKConversionError (Either TKConversionError SomeTK -> Either String SomeTK)
-> (TKUnknown -> Either TKConversionError SomeTK)
-> TKUnknown
-> Either String SomeTK
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TKUnknown -> Either TKConversionError SomeTK
fromUnknownToTKEither
data TKWithWireRep =
TKWithWireRep
{ TKWithWireRep -> WireRepRefs
_tkWireRepRefs :: WireRepRefs
, TKWithWireRep -> Maybe ByteRange
_tkWireRepRange :: Maybe ByteRange
, TKWithWireRep -> [PktWithWireRep]
_tkPackets :: [PktWithWireRep]
, TKWithWireRep -> TKUnknown
_tkValue :: TKUnknown
}
deriving (Typeable TKWithWireRep
Typeable TKWithWireRep =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKWithWireRep -> c TKWithWireRep)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKWithWireRep)
-> (TKWithWireRep -> Constr)
-> (TKWithWireRep -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKWithWireRep))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TKWithWireRep))
-> ((forall b. Data b => b -> b) -> TKWithWireRep -> TKWithWireRep)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TKWithWireRep -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TKWithWireRep -> r)
-> (forall u. (forall d. Data d => d -> u) -> TKWithWireRep -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> TKWithWireRep -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep)
-> Data TKWithWireRep
TKWithWireRep -> Constr
TKWithWireRep -> DataType
(forall b. Data b => b -> b) -> TKWithWireRep -> TKWithWireRep
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) -> TKWithWireRep -> u
forall u. (forall d. Data d => d -> u) -> TKWithWireRep -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TKWithWireRep -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TKWithWireRep -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKWithWireRep
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKWithWireRep -> c TKWithWireRep
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKWithWireRep)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TKWithWireRep)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKWithWireRep -> c TKWithWireRep
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> TKWithWireRep -> c TKWithWireRep
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKWithWireRep
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKWithWireRep
$ctoConstr :: TKWithWireRep -> Constr
toConstr :: TKWithWireRep -> Constr
$cdataTypeOf :: TKWithWireRep -> DataType
dataTypeOf :: TKWithWireRep -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKWithWireRep)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKWithWireRep)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TKWithWireRep)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TKWithWireRep)
$cgmapT :: (forall b. Data b => b -> b) -> TKWithWireRep -> TKWithWireRep
gmapT :: (forall b. Data b => b -> b) -> TKWithWireRep -> TKWithWireRep
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TKWithWireRep -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> TKWithWireRep -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TKWithWireRep -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> TKWithWireRep -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> TKWithWireRep -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> TKWithWireRep -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TKWithWireRep -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> TKWithWireRep -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> TKWithWireRep -> m TKWithWireRep
Data, TKWithWireRep -> TKWithWireRep -> Bool
(TKWithWireRep -> TKWithWireRep -> Bool)
-> (TKWithWireRep -> TKWithWireRep -> Bool) -> Eq TKWithWireRep
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TKWithWireRep -> TKWithWireRep -> Bool
== :: TKWithWireRep -> TKWithWireRep -> Bool
$c/= :: TKWithWireRep -> TKWithWireRep -> Bool
/= :: TKWithWireRep -> TKWithWireRep -> Bool
Eq, (forall x. TKWithWireRep -> Rep TKWithWireRep x)
-> (forall x. Rep TKWithWireRep x -> TKWithWireRep)
-> Generic TKWithWireRep
forall x. Rep TKWithWireRep x -> TKWithWireRep
forall x. TKWithWireRep -> Rep TKWithWireRep x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TKWithWireRep -> Rep TKWithWireRep x
from :: forall x. TKWithWireRep -> Rep TKWithWireRep x
$cto :: forall x. Rep TKWithWireRep x -> TKWithWireRep
to :: forall x. Rep TKWithWireRep x -> TKWithWireRep
Generic, Eq TKWithWireRep
Eq TKWithWireRep =>
(TKWithWireRep -> TKWithWireRep -> Ordering)
-> (TKWithWireRep -> TKWithWireRep -> Bool)
-> (TKWithWireRep -> TKWithWireRep -> Bool)
-> (TKWithWireRep -> TKWithWireRep -> Bool)
-> (TKWithWireRep -> TKWithWireRep -> Bool)
-> (TKWithWireRep -> TKWithWireRep -> TKWithWireRep)
-> (TKWithWireRep -> TKWithWireRep -> TKWithWireRep)
-> Ord TKWithWireRep
TKWithWireRep -> TKWithWireRep -> Bool
TKWithWireRep -> TKWithWireRep -> Ordering
TKWithWireRep -> TKWithWireRep -> TKWithWireRep
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TKWithWireRep -> TKWithWireRep -> Ordering
compare :: TKWithWireRep -> TKWithWireRep -> Ordering
$c< :: TKWithWireRep -> TKWithWireRep -> Bool
< :: TKWithWireRep -> TKWithWireRep -> Bool
$c<= :: TKWithWireRep -> TKWithWireRep -> Bool
<= :: TKWithWireRep -> TKWithWireRep -> Bool
$c> :: TKWithWireRep -> TKWithWireRep -> Bool
> :: TKWithWireRep -> TKWithWireRep -> Bool
$c>= :: TKWithWireRep -> TKWithWireRep -> Bool
>= :: TKWithWireRep -> TKWithWireRep -> Bool
$cmax :: TKWithWireRep -> TKWithWireRep -> TKWithWireRep
max :: TKWithWireRep -> TKWithWireRep -> TKWithWireRep
$cmin :: TKWithWireRep -> TKWithWireRep -> TKWithWireRep
min :: TKWithWireRep -> TKWithWireRep -> TKWithWireRep
Ord, Int -> TKWithWireRep -> ShowS
[TKWithWireRep] -> ShowS
TKWithWireRep -> String
(Int -> TKWithWireRep -> ShowS)
-> (TKWithWireRep -> String)
-> ([TKWithWireRep] -> ShowS)
-> Show TKWithWireRep
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TKWithWireRep -> ShowS
showsPrec :: Int -> TKWithWireRep -> ShowS
$cshow :: TKWithWireRep -> String
show :: TKWithWireRep -> String
$cshowList :: [TKWithWireRep] -> ShowS
showList :: [TKWithWireRep] -> ShowS
Show, Typeable)
data PacketRefId =
PacketRefId
{ PacketRefId -> WireRepRef
_packetRefWireRepRef :: WireRepRef
, PacketRefId -> Int
_packetRefIndex :: Int
}
deriving (Typeable PacketRefId
Typeable PacketRefId =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PacketRefId -> c PacketRefId)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PacketRefId)
-> (PacketRefId -> Constr)
-> (PacketRefId -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PacketRefId))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PacketRefId))
-> ((forall b. Data b => b -> b) -> PacketRefId -> PacketRefId)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PacketRefId -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PacketRefId -> r)
-> (forall u. (forall d. Data d => d -> u) -> PacketRefId -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> PacketRefId -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId)
-> Data PacketRefId
PacketRefId -> Constr
PacketRefId -> DataType
(forall b. Data b => b -> b) -> PacketRefId -> PacketRefId
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) -> PacketRefId -> u
forall u. (forall d. Data d => d -> u) -> PacketRefId -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PacketRefId -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PacketRefId -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PacketRefId
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PacketRefId -> c PacketRefId
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PacketRefId)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PacketRefId)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PacketRefId -> c PacketRefId
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PacketRefId -> c PacketRefId
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PacketRefId
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PacketRefId
$ctoConstr :: PacketRefId -> Constr
toConstr :: PacketRefId -> Constr
$cdataTypeOf :: PacketRefId -> DataType
dataTypeOf :: PacketRefId -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PacketRefId)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PacketRefId)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PacketRefId)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PacketRefId)
$cgmapT :: (forall b. Data b => b -> b) -> PacketRefId -> PacketRefId
gmapT :: (forall b. Data b => b -> b) -> PacketRefId -> PacketRefId
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PacketRefId -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PacketRefId -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PacketRefId -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PacketRefId -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PacketRefId -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> PacketRefId -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PacketRefId -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> PacketRefId -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> PacketRefId -> m PacketRefId
Data, PacketRefId -> PacketRefId -> Bool
(PacketRefId -> PacketRefId -> Bool)
-> (PacketRefId -> PacketRefId -> Bool) -> Eq PacketRefId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PacketRefId -> PacketRefId -> Bool
== :: PacketRefId -> PacketRefId -> Bool
$c/= :: PacketRefId -> PacketRefId -> Bool
/= :: PacketRefId -> PacketRefId -> Bool
Eq, (forall x. PacketRefId -> Rep PacketRefId x)
-> (forall x. Rep PacketRefId x -> PacketRefId)
-> Generic PacketRefId
forall x. Rep PacketRefId x -> PacketRefId
forall x. PacketRefId -> Rep PacketRefId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PacketRefId -> Rep PacketRefId x
from :: forall x. PacketRefId -> Rep PacketRefId x
$cto :: forall x. Rep PacketRefId x -> PacketRefId
to :: forall x. Rep PacketRefId x -> PacketRefId
Generic, Eq PacketRefId
Eq PacketRefId =>
(PacketRefId -> PacketRefId -> Ordering)
-> (PacketRefId -> PacketRefId -> Bool)
-> (PacketRefId -> PacketRefId -> Bool)
-> (PacketRefId -> PacketRefId -> Bool)
-> (PacketRefId -> PacketRefId -> Bool)
-> (PacketRefId -> PacketRefId -> PacketRefId)
-> (PacketRefId -> PacketRefId -> PacketRefId)
-> Ord PacketRefId
PacketRefId -> PacketRefId -> Bool
PacketRefId -> PacketRefId -> Ordering
PacketRefId -> PacketRefId -> PacketRefId
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: PacketRefId -> PacketRefId -> Ordering
compare :: PacketRefId -> PacketRefId -> Ordering
$c< :: PacketRefId -> PacketRefId -> Bool
< :: PacketRefId -> PacketRefId -> Bool
$c<= :: PacketRefId -> PacketRefId -> Bool
<= :: PacketRefId -> PacketRefId -> Bool
$c> :: PacketRefId -> PacketRefId -> Bool
> :: PacketRefId -> PacketRefId -> Bool
$c>= :: PacketRefId -> PacketRefId -> Bool
>= :: PacketRefId -> PacketRefId -> Bool
$cmax :: PacketRefId -> PacketRefId -> PacketRefId
max :: PacketRefId -> PacketRefId -> PacketRefId
$cmin :: PacketRefId -> PacketRefId -> PacketRefId
min :: PacketRefId -> PacketRefId -> PacketRefId
Ord, Int -> PacketRefId -> ShowS
[PacketRefId] -> ShowS
PacketRefId -> String
(Int -> PacketRefId -> ShowS)
-> (PacketRefId -> String)
-> ([PacketRefId] -> ShowS)
-> Show PacketRefId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PacketRefId -> ShowS
showsPrec :: Int -> PacketRefId -> ShowS
$cshow :: PacketRefId -> String
show :: PacketRefId -> String
$cshowList :: [PacketRefId] -> ShowS
showList :: [PacketRefId] -> ShowS
Show, Typeable)
data SignatureWithWireRef =
SignatureWithWireRef
{ SignatureWithWireRef -> SignaturePayload
_signatureWithWireRefValue :: SignaturePayload
, SignatureWithWireRef -> PacketRefId
_signatureWithWireRefRef :: PacketRefId
}
deriving (Typeable SignatureWithWireRef
Typeable SignatureWithWireRef =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SignatureWithWireRef
-> c SignatureWithWireRef)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SignatureWithWireRef)
-> (SignatureWithWireRef -> Constr)
-> (SignatureWithWireRef -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SignatureWithWireRef))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SignatureWithWireRef))
-> ((forall b. Data b => b -> b)
-> SignatureWithWireRef -> SignatureWithWireRef)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SignatureWithWireRef -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SignatureWithWireRef -> r)
-> (forall u.
(forall d. Data d => d -> u) -> SignatureWithWireRef -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> SignatureWithWireRef -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef)
-> Data SignatureWithWireRef
SignatureWithWireRef -> Constr
SignatureWithWireRef -> DataType
(forall b. Data b => b -> b)
-> SignatureWithWireRef -> SignatureWithWireRef
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) -> SignatureWithWireRef -> u
forall u.
(forall d. Data d => d -> u) -> SignatureWithWireRef -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SignatureWithWireRef -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SignatureWithWireRef -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SignatureWithWireRef
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SignatureWithWireRef
-> c SignatureWithWireRef
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SignatureWithWireRef)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SignatureWithWireRef)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SignatureWithWireRef
-> c SignatureWithWireRef
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SignatureWithWireRef
-> c SignatureWithWireRef
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SignatureWithWireRef
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SignatureWithWireRef
$ctoConstr :: SignatureWithWireRef -> Constr
toConstr :: SignatureWithWireRef -> Constr
$cdataTypeOf :: SignatureWithWireRef -> DataType
dataTypeOf :: SignatureWithWireRef -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SignatureWithWireRef)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SignatureWithWireRef)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SignatureWithWireRef)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SignatureWithWireRef)
$cgmapT :: (forall b. Data b => b -> b)
-> SignatureWithWireRef -> SignatureWithWireRef
gmapT :: (forall b. Data b => b -> b)
-> SignatureWithWireRef -> SignatureWithWireRef
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SignatureWithWireRef -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SignatureWithWireRef -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SignatureWithWireRef -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SignatureWithWireRef -> r
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> SignatureWithWireRef -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u) -> SignatureWithWireRef -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SignatureWithWireRef -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SignatureWithWireRef -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignatureWithWireRef -> m SignatureWithWireRef
Data, SignatureWithWireRef -> SignatureWithWireRef -> Bool
(SignatureWithWireRef -> SignatureWithWireRef -> Bool)
-> (SignatureWithWireRef -> SignatureWithWireRef -> Bool)
-> Eq SignatureWithWireRef
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
== :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
$c/= :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
/= :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
Eq, (forall x. SignatureWithWireRef -> Rep SignatureWithWireRef x)
-> (forall x. Rep SignatureWithWireRef x -> SignatureWithWireRef)
-> Generic SignatureWithWireRef
forall x. Rep SignatureWithWireRef x -> SignatureWithWireRef
forall x. SignatureWithWireRef -> Rep SignatureWithWireRef x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SignatureWithWireRef -> Rep SignatureWithWireRef x
from :: forall x. SignatureWithWireRef -> Rep SignatureWithWireRef x
$cto :: forall x. Rep SignatureWithWireRef x -> SignatureWithWireRef
to :: forall x. Rep SignatureWithWireRef x -> SignatureWithWireRef
Generic, Eq SignatureWithWireRef
Eq SignatureWithWireRef =>
(SignatureWithWireRef -> SignatureWithWireRef -> Ordering)
-> (SignatureWithWireRef -> SignatureWithWireRef -> Bool)
-> (SignatureWithWireRef -> SignatureWithWireRef -> Bool)
-> (SignatureWithWireRef -> SignatureWithWireRef -> Bool)
-> (SignatureWithWireRef -> SignatureWithWireRef -> Bool)
-> (SignatureWithWireRef
-> SignatureWithWireRef -> SignatureWithWireRef)
-> (SignatureWithWireRef
-> SignatureWithWireRef -> SignatureWithWireRef)
-> Ord SignatureWithWireRef
SignatureWithWireRef -> SignatureWithWireRef -> Bool
SignatureWithWireRef -> SignatureWithWireRef -> Ordering
SignatureWithWireRef
-> SignatureWithWireRef -> SignatureWithWireRef
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SignatureWithWireRef -> SignatureWithWireRef -> Ordering
compare :: SignatureWithWireRef -> SignatureWithWireRef -> Ordering
$c< :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
< :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
$c<= :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
<= :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
$c> :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
> :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
$c>= :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
>= :: SignatureWithWireRef -> SignatureWithWireRef -> Bool
$cmax :: SignatureWithWireRef
-> SignatureWithWireRef -> SignatureWithWireRef
max :: SignatureWithWireRef
-> SignatureWithWireRef -> SignatureWithWireRef
$cmin :: SignatureWithWireRef
-> SignatureWithWireRef -> SignatureWithWireRef
min :: SignatureWithWireRef
-> SignatureWithWireRef -> SignatureWithWireRef
Ord, Int -> SignatureWithWireRef -> ShowS
[SignatureWithWireRef] -> ShowS
SignatureWithWireRef -> String
(Int -> SignatureWithWireRef -> ShowS)
-> (SignatureWithWireRef -> String)
-> ([SignatureWithWireRef] -> ShowS)
-> Show SignatureWithWireRef
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SignatureWithWireRef -> ShowS
showsPrec :: Int -> SignatureWithWireRef -> ShowS
$cshow :: SignatureWithWireRef -> String
show :: SignatureWithWireRef -> String
$cshowList :: [SignatureWithWireRef] -> ShowS
showList :: [SignatureWithWireRef] -> ShowS
Show, Typeable)
data UIDWithWireRefs =
UIDWithWireRefs
{ UIDWithWireRefs -> Text
_uidWithWireRefsValue :: Text
, UIDWithWireRefs -> PacketRefId
_uidWithWireRefsRef :: PacketRefId
, UIDWithWireRefs -> [SignatureWithWireRef]
_uidWithWireRefsSignatures :: [SignatureWithWireRef]
}
deriving (Typeable UIDWithWireRefs
Typeable UIDWithWireRefs =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UIDWithWireRefs -> c UIDWithWireRefs)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UIDWithWireRefs)
-> (UIDWithWireRefs -> Constr)
-> (UIDWithWireRefs -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UIDWithWireRefs))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UIDWithWireRefs))
-> ((forall b. Data b => b -> b)
-> UIDWithWireRefs -> UIDWithWireRefs)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UIDWithWireRefs -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UIDWithWireRefs -> r)
-> (forall u.
(forall d. Data d => d -> u) -> UIDWithWireRefs -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> UIDWithWireRefs -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs)
-> Data UIDWithWireRefs
UIDWithWireRefs -> Constr
UIDWithWireRefs -> DataType
(forall b. Data b => b -> b) -> UIDWithWireRefs -> UIDWithWireRefs
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) -> UIDWithWireRefs -> u
forall u. (forall d. Data d => d -> u) -> UIDWithWireRefs -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UIDWithWireRefs -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UIDWithWireRefs -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UIDWithWireRefs
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UIDWithWireRefs -> c UIDWithWireRefs
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UIDWithWireRefs)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UIDWithWireRefs)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UIDWithWireRefs -> c UIDWithWireRefs
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UIDWithWireRefs -> c UIDWithWireRefs
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UIDWithWireRefs
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UIDWithWireRefs
$ctoConstr :: UIDWithWireRefs -> Constr
toConstr :: UIDWithWireRefs -> Constr
$cdataTypeOf :: UIDWithWireRefs -> DataType
dataTypeOf :: UIDWithWireRefs -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UIDWithWireRefs)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UIDWithWireRefs)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UIDWithWireRefs)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UIDWithWireRefs)
$cgmapT :: (forall b. Data b => b -> b) -> UIDWithWireRefs -> UIDWithWireRefs
gmapT :: (forall b. Data b => b -> b) -> UIDWithWireRefs -> UIDWithWireRefs
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UIDWithWireRefs -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UIDWithWireRefs -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UIDWithWireRefs -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UIDWithWireRefs -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> UIDWithWireRefs -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> UIDWithWireRefs -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> UIDWithWireRefs -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> UIDWithWireRefs -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UIDWithWireRefs -> m UIDWithWireRefs
Data, UIDWithWireRefs -> UIDWithWireRefs -> Bool
(UIDWithWireRefs -> UIDWithWireRefs -> Bool)
-> (UIDWithWireRefs -> UIDWithWireRefs -> Bool)
-> Eq UIDWithWireRefs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
== :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
$c/= :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
/= :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
Eq, (forall x. UIDWithWireRefs -> Rep UIDWithWireRefs x)
-> (forall x. Rep UIDWithWireRefs x -> UIDWithWireRefs)
-> Generic UIDWithWireRefs
forall x. Rep UIDWithWireRefs x -> UIDWithWireRefs
forall x. UIDWithWireRefs -> Rep UIDWithWireRefs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. UIDWithWireRefs -> Rep UIDWithWireRefs x
from :: forall x. UIDWithWireRefs -> Rep UIDWithWireRefs x
$cto :: forall x. Rep UIDWithWireRefs x -> UIDWithWireRefs
to :: forall x. Rep UIDWithWireRefs x -> UIDWithWireRefs
Generic, Eq UIDWithWireRefs
Eq UIDWithWireRefs =>
(UIDWithWireRefs -> UIDWithWireRefs -> Ordering)
-> (UIDWithWireRefs -> UIDWithWireRefs -> Bool)
-> (UIDWithWireRefs -> UIDWithWireRefs -> Bool)
-> (UIDWithWireRefs -> UIDWithWireRefs -> Bool)
-> (UIDWithWireRefs -> UIDWithWireRefs -> Bool)
-> (UIDWithWireRefs -> UIDWithWireRefs -> UIDWithWireRefs)
-> (UIDWithWireRefs -> UIDWithWireRefs -> UIDWithWireRefs)
-> Ord UIDWithWireRefs
UIDWithWireRefs -> UIDWithWireRefs -> Bool
UIDWithWireRefs -> UIDWithWireRefs -> Ordering
UIDWithWireRefs -> UIDWithWireRefs -> UIDWithWireRefs
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: UIDWithWireRefs -> UIDWithWireRefs -> Ordering
compare :: UIDWithWireRefs -> UIDWithWireRefs -> Ordering
$c< :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
< :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
$c<= :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
<= :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
$c> :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
> :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
$c>= :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
>= :: UIDWithWireRefs -> UIDWithWireRefs -> Bool
$cmax :: UIDWithWireRefs -> UIDWithWireRefs -> UIDWithWireRefs
max :: UIDWithWireRefs -> UIDWithWireRefs -> UIDWithWireRefs
$cmin :: UIDWithWireRefs -> UIDWithWireRefs -> UIDWithWireRefs
min :: UIDWithWireRefs -> UIDWithWireRefs -> UIDWithWireRefs
Ord, Int -> UIDWithWireRefs -> ShowS
[UIDWithWireRefs] -> ShowS
UIDWithWireRefs -> String
(Int -> UIDWithWireRefs -> ShowS)
-> (UIDWithWireRefs -> String)
-> ([UIDWithWireRefs] -> ShowS)
-> Show UIDWithWireRefs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UIDWithWireRefs -> ShowS
showsPrec :: Int -> UIDWithWireRefs -> ShowS
$cshow :: UIDWithWireRefs -> String
show :: UIDWithWireRefs -> String
$cshowList :: [UIDWithWireRefs] -> ShowS
showList :: [UIDWithWireRefs] -> ShowS
Show, Typeable)
data UATWithWireRefs =
UATWithWireRefs
{ UATWithWireRefs -> [UserAttrSubPacket]
_uatWithWireRefsValue :: [UserAttrSubPacket]
, UATWithWireRefs -> PacketRefId
_uatWithWireRefsRef :: PacketRefId
, UATWithWireRefs -> [SignatureWithWireRef]
_uatWithWireRefsSignatures :: [SignatureWithWireRef]
}
deriving (Typeable UATWithWireRefs
Typeable UATWithWireRefs =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UATWithWireRefs -> c UATWithWireRefs)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UATWithWireRefs)
-> (UATWithWireRefs -> Constr)
-> (UATWithWireRefs -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UATWithWireRefs))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UATWithWireRefs))
-> ((forall b. Data b => b -> b)
-> UATWithWireRefs -> UATWithWireRefs)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UATWithWireRefs -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UATWithWireRefs -> r)
-> (forall u.
(forall d. Data d => d -> u) -> UATWithWireRefs -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> UATWithWireRefs -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs)
-> Data UATWithWireRefs
UATWithWireRefs -> Constr
UATWithWireRefs -> DataType
(forall b. Data b => b -> b) -> UATWithWireRefs -> UATWithWireRefs
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) -> UATWithWireRefs -> u
forall u. (forall d. Data d => d -> u) -> UATWithWireRefs -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UATWithWireRefs -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UATWithWireRefs -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UATWithWireRefs
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UATWithWireRefs -> c UATWithWireRefs
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UATWithWireRefs)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UATWithWireRefs)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UATWithWireRefs -> c UATWithWireRefs
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UATWithWireRefs -> c UATWithWireRefs
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UATWithWireRefs
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UATWithWireRefs
$ctoConstr :: UATWithWireRefs -> Constr
toConstr :: UATWithWireRefs -> Constr
$cdataTypeOf :: UATWithWireRefs -> DataType
dataTypeOf :: UATWithWireRefs -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UATWithWireRefs)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UATWithWireRefs)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UATWithWireRefs)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UATWithWireRefs)
$cgmapT :: (forall b. Data b => b -> b) -> UATWithWireRefs -> UATWithWireRefs
gmapT :: (forall b. Data b => b -> b) -> UATWithWireRefs -> UATWithWireRefs
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UATWithWireRefs -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UATWithWireRefs -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UATWithWireRefs -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UATWithWireRefs -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> UATWithWireRefs -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> UATWithWireRefs -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> UATWithWireRefs -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> UATWithWireRefs -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UATWithWireRefs -> m UATWithWireRefs
Data, UATWithWireRefs -> UATWithWireRefs -> Bool
(UATWithWireRefs -> UATWithWireRefs -> Bool)
-> (UATWithWireRefs -> UATWithWireRefs -> Bool)
-> Eq UATWithWireRefs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UATWithWireRefs -> UATWithWireRefs -> Bool
== :: UATWithWireRefs -> UATWithWireRefs -> Bool
$c/= :: UATWithWireRefs -> UATWithWireRefs -> Bool
/= :: UATWithWireRefs -> UATWithWireRefs -> Bool
Eq, (forall x. UATWithWireRefs -> Rep UATWithWireRefs x)
-> (forall x. Rep UATWithWireRefs x -> UATWithWireRefs)
-> Generic UATWithWireRefs
forall x. Rep UATWithWireRefs x -> UATWithWireRefs
forall x. UATWithWireRefs -> Rep UATWithWireRefs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. UATWithWireRefs -> Rep UATWithWireRefs x
from :: forall x. UATWithWireRefs -> Rep UATWithWireRefs x
$cto :: forall x. Rep UATWithWireRefs x -> UATWithWireRefs
to :: forall x. Rep UATWithWireRefs x -> UATWithWireRefs
Generic, Eq UATWithWireRefs
Eq UATWithWireRefs =>
(UATWithWireRefs -> UATWithWireRefs -> Ordering)
-> (UATWithWireRefs -> UATWithWireRefs -> Bool)
-> (UATWithWireRefs -> UATWithWireRefs -> Bool)
-> (UATWithWireRefs -> UATWithWireRefs -> Bool)
-> (UATWithWireRefs -> UATWithWireRefs -> Bool)
-> (UATWithWireRefs -> UATWithWireRefs -> UATWithWireRefs)
-> (UATWithWireRefs -> UATWithWireRefs -> UATWithWireRefs)
-> Ord UATWithWireRefs
UATWithWireRefs -> UATWithWireRefs -> Bool
UATWithWireRefs -> UATWithWireRefs -> Ordering
UATWithWireRefs -> UATWithWireRefs -> UATWithWireRefs
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: UATWithWireRefs -> UATWithWireRefs -> Ordering
compare :: UATWithWireRefs -> UATWithWireRefs -> Ordering
$c< :: UATWithWireRefs -> UATWithWireRefs -> Bool
< :: UATWithWireRefs -> UATWithWireRefs -> Bool
$c<= :: UATWithWireRefs -> UATWithWireRefs -> Bool
<= :: UATWithWireRefs -> UATWithWireRefs -> Bool
$c> :: UATWithWireRefs -> UATWithWireRefs -> Bool
> :: UATWithWireRefs -> UATWithWireRefs -> Bool
$c>= :: UATWithWireRefs -> UATWithWireRefs -> Bool
>= :: UATWithWireRefs -> UATWithWireRefs -> Bool
$cmax :: UATWithWireRefs -> UATWithWireRefs -> UATWithWireRefs
max :: UATWithWireRefs -> UATWithWireRefs -> UATWithWireRefs
$cmin :: UATWithWireRefs -> UATWithWireRefs -> UATWithWireRefs
min :: UATWithWireRefs -> UATWithWireRefs -> UATWithWireRefs
Ord, Int -> UATWithWireRefs -> ShowS
[UATWithWireRefs] -> ShowS
UATWithWireRefs -> String
(Int -> UATWithWireRefs -> ShowS)
-> (UATWithWireRefs -> String)
-> ([UATWithWireRefs] -> ShowS)
-> Show UATWithWireRefs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> UATWithWireRefs -> ShowS
showsPrec :: Int -> UATWithWireRefs -> ShowS
$cshow :: UATWithWireRefs -> String
show :: UATWithWireRefs -> String
$cshowList :: [UATWithWireRefs] -> ShowS
showList :: [UATWithWireRefs] -> ShowS
Show, Typeable)
data SubkeyWithWireRefs =
SubkeyWithWireRefs
{ SubkeyWithWireRefs -> Pkt
_subkeyWithWireRefsValue :: Pkt
, SubkeyWithWireRefs -> PacketRefId
_subkeyWithWireRefsRef :: PacketRefId
, SubkeyWithWireRefs -> [SignatureWithWireRef]
_subkeyWithWireRefsSignatures :: [SignatureWithWireRef]
}
deriving (Typeable SubkeyWithWireRefs
Typeable SubkeyWithWireRefs =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SubkeyWithWireRefs
-> c SubkeyWithWireRefs)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SubkeyWithWireRefs)
-> (SubkeyWithWireRefs -> Constr)
-> (SubkeyWithWireRefs -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SubkeyWithWireRefs))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SubkeyWithWireRefs))
-> ((forall b. Data b => b -> b)
-> SubkeyWithWireRefs -> SubkeyWithWireRefs)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SubkeyWithWireRefs -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SubkeyWithWireRefs -> r)
-> (forall u.
(forall d. Data d => d -> u) -> SubkeyWithWireRefs -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> SubkeyWithWireRefs -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs)
-> Data SubkeyWithWireRefs
SubkeyWithWireRefs -> Constr
SubkeyWithWireRefs -> DataType
(forall b. Data b => b -> b)
-> SubkeyWithWireRefs -> SubkeyWithWireRefs
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) -> SubkeyWithWireRefs -> u
forall u. (forall d. Data d => d -> u) -> SubkeyWithWireRefs -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SubkeyWithWireRefs -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SubkeyWithWireRefs -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SubkeyWithWireRefs
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SubkeyWithWireRefs
-> c SubkeyWithWireRefs
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SubkeyWithWireRefs)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SubkeyWithWireRefs)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SubkeyWithWireRefs
-> c SubkeyWithWireRefs
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SubkeyWithWireRefs
-> c SubkeyWithWireRefs
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SubkeyWithWireRefs
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SubkeyWithWireRefs
$ctoConstr :: SubkeyWithWireRefs -> Constr
toConstr :: SubkeyWithWireRefs -> Constr
$cdataTypeOf :: SubkeyWithWireRefs -> DataType
dataTypeOf :: SubkeyWithWireRefs -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SubkeyWithWireRefs)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SubkeyWithWireRefs)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SubkeyWithWireRefs)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SubkeyWithWireRefs)
$cgmapT :: (forall b. Data b => b -> b)
-> SubkeyWithWireRefs -> SubkeyWithWireRefs
gmapT :: (forall b. Data b => b -> b)
-> SubkeyWithWireRefs -> SubkeyWithWireRefs
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SubkeyWithWireRefs -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SubkeyWithWireRefs -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SubkeyWithWireRefs -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SubkeyWithWireRefs -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SubkeyWithWireRefs -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> SubkeyWithWireRefs -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SubkeyWithWireRefs -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SubkeyWithWireRefs -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SubkeyWithWireRefs -> m SubkeyWithWireRefs
Data, SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
(SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool)
-> (SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool)
-> Eq SubkeyWithWireRefs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
== :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
$c/= :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
/= :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
Eq, (forall x. SubkeyWithWireRefs -> Rep SubkeyWithWireRefs x)
-> (forall x. Rep SubkeyWithWireRefs x -> SubkeyWithWireRefs)
-> Generic SubkeyWithWireRefs
forall x. Rep SubkeyWithWireRefs x -> SubkeyWithWireRefs
forall x. SubkeyWithWireRefs -> Rep SubkeyWithWireRefs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SubkeyWithWireRefs -> Rep SubkeyWithWireRefs x
from :: forall x. SubkeyWithWireRefs -> Rep SubkeyWithWireRefs x
$cto :: forall x. Rep SubkeyWithWireRefs x -> SubkeyWithWireRefs
to :: forall x. Rep SubkeyWithWireRefs x -> SubkeyWithWireRefs
Generic, Eq SubkeyWithWireRefs
Eq SubkeyWithWireRefs =>
(SubkeyWithWireRefs -> SubkeyWithWireRefs -> Ordering)
-> (SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool)
-> (SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool)
-> (SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool)
-> (SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool)
-> (SubkeyWithWireRefs -> SubkeyWithWireRefs -> SubkeyWithWireRefs)
-> (SubkeyWithWireRefs -> SubkeyWithWireRefs -> SubkeyWithWireRefs)
-> Ord SubkeyWithWireRefs
SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
SubkeyWithWireRefs -> SubkeyWithWireRefs -> Ordering
SubkeyWithWireRefs -> SubkeyWithWireRefs -> SubkeyWithWireRefs
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Ordering
compare :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Ordering
$c< :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
< :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
$c<= :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
<= :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
$c> :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
> :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
$c>= :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
>= :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> Bool
$cmax :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> SubkeyWithWireRefs
max :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> SubkeyWithWireRefs
$cmin :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> SubkeyWithWireRefs
min :: SubkeyWithWireRefs -> SubkeyWithWireRefs -> SubkeyWithWireRefs
Ord, Int -> SubkeyWithWireRefs -> ShowS
[SubkeyWithWireRefs] -> ShowS
SubkeyWithWireRefs -> String
(Int -> SubkeyWithWireRefs -> ShowS)
-> (SubkeyWithWireRefs -> String)
-> ([SubkeyWithWireRefs] -> ShowS)
-> Show SubkeyWithWireRefs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SubkeyWithWireRefs -> ShowS
showsPrec :: Int -> SubkeyWithWireRefs -> ShowS
$cshow :: SubkeyWithWireRefs -> String
show :: SubkeyWithWireRefs -> String
$cshowList :: [SubkeyWithWireRefs] -> ShowS
showList :: [SubkeyWithWireRefs] -> ShowS
Show, Typeable)
data TKStructuredWithWireRep =
TKStructuredWithWireRep
{ TKStructuredWithWireRep -> WireRepRefs
_tkStructuredWireRepRefs :: WireRepRefs
, TKStructuredWithWireRep -> Maybe ByteRange
_tkStructuredWireRepRange :: Maybe ByteRange
, TKStructuredWithWireRep -> (SomePKPayload, Maybe SKAddendum)
_tkStructuredPrimaryKey :: (SomePKPayload, Maybe SKAddendum)
, TKStructuredWithWireRep -> PacketRefId
_tkStructuredPrimaryKeyRef :: PacketRefId
, TKStructuredWithWireRep -> [SignatureWithWireRef]
_tkStructuredDirectSignatures :: [SignatureWithWireRef]
, TKStructuredWithWireRep -> [UIDWithWireRefs]
_tkStructuredUIDs :: [UIDWithWireRefs]
, TKStructuredWithWireRep -> [UATWithWireRefs]
_tkStructuredUAts :: [UATWithWireRefs]
, TKStructuredWithWireRep -> [SubkeyWithWireRefs]
_tkStructuredSubkeys :: [SubkeyWithWireRefs]
, TKStructuredWithWireRep -> [PktWithWireRep]
_tkStructuredPacketRefs :: [PktWithWireRep]
}
deriving (Typeable TKStructuredWithWireRep
Typeable TKStructuredWithWireRep =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TKStructuredWithWireRep
-> c TKStructuredWithWireRep)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKStructuredWithWireRep)
-> (TKStructuredWithWireRep -> Constr)
-> (TKStructuredWithWireRep -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKStructuredWithWireRep))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TKStructuredWithWireRep))
-> ((forall b. Data b => b -> b)
-> TKStructuredWithWireRep -> TKStructuredWithWireRep)
-> (forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> TKStructuredWithWireRep
-> r)
-> (forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> TKStructuredWithWireRep
-> r)
-> (forall u.
(forall d. Data d => d -> u) -> TKStructuredWithWireRep -> [u])
-> (forall u.
Int
-> (forall d. Data d => d -> u) -> TKStructuredWithWireRep -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep)
-> Data TKStructuredWithWireRep
TKStructuredWithWireRep -> Constr
TKStructuredWithWireRep -> DataType
(forall b. Data b => b -> b)
-> TKStructuredWithWireRep -> TKStructuredWithWireRep
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) -> TKStructuredWithWireRep -> u
forall u.
(forall d. Data d => d -> u) -> TKStructuredWithWireRep -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> TKStructuredWithWireRep
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> TKStructuredWithWireRep
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKStructuredWithWireRep
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TKStructuredWithWireRep
-> c TKStructuredWithWireRep
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKStructuredWithWireRep)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TKStructuredWithWireRep)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TKStructuredWithWireRep
-> c TKStructuredWithWireRep
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TKStructuredWithWireRep
-> c TKStructuredWithWireRep
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKStructuredWithWireRep
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TKStructuredWithWireRep
$ctoConstr :: TKStructuredWithWireRep -> Constr
toConstr :: TKStructuredWithWireRep -> Constr
$cdataTypeOf :: TKStructuredWithWireRep -> DataType
dataTypeOf :: TKStructuredWithWireRep -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKStructuredWithWireRep)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TKStructuredWithWireRep)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TKStructuredWithWireRep)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TKStructuredWithWireRep)
$cgmapT :: (forall b. Data b => b -> b)
-> TKStructuredWithWireRep -> TKStructuredWithWireRep
gmapT :: (forall b. Data b => b -> b)
-> TKStructuredWithWireRep -> TKStructuredWithWireRep
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> TKStructuredWithWireRep
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> TKStructuredWithWireRep
-> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> TKStructuredWithWireRep
-> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> TKStructuredWithWireRep
-> r
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> TKStructuredWithWireRep -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u) -> TKStructuredWithWireRep -> [u]
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> TKStructuredWithWireRep -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> TKStructuredWithWireRep -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TKStructuredWithWireRep -> m TKStructuredWithWireRep
Data, TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
(TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool)
-> (TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool)
-> Eq TKStructuredWithWireRep
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
== :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
$c/= :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
/= :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
Eq, (forall x.
TKStructuredWithWireRep -> Rep TKStructuredWithWireRep x)
-> (forall x.
Rep TKStructuredWithWireRep x -> TKStructuredWithWireRep)
-> Generic TKStructuredWithWireRep
forall x. Rep TKStructuredWithWireRep x -> TKStructuredWithWireRep
forall x. TKStructuredWithWireRep -> Rep TKStructuredWithWireRep x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. TKStructuredWithWireRep -> Rep TKStructuredWithWireRep x
from :: forall x. TKStructuredWithWireRep -> Rep TKStructuredWithWireRep x
$cto :: forall x. Rep TKStructuredWithWireRep x -> TKStructuredWithWireRep
to :: forall x. Rep TKStructuredWithWireRep x -> TKStructuredWithWireRep
Generic, Eq TKStructuredWithWireRep
Eq TKStructuredWithWireRep =>
(TKStructuredWithWireRep -> TKStructuredWithWireRep -> Ordering)
-> (TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool)
-> (TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool)
-> (TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool)
-> (TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool)
-> (TKStructuredWithWireRep
-> TKStructuredWithWireRep -> TKStructuredWithWireRep)
-> (TKStructuredWithWireRep
-> TKStructuredWithWireRep -> TKStructuredWithWireRep)
-> Ord TKStructuredWithWireRep
TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
TKStructuredWithWireRep -> TKStructuredWithWireRep -> Ordering
TKStructuredWithWireRep
-> TKStructuredWithWireRep -> TKStructuredWithWireRep
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Ordering
compare :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Ordering
$c< :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
< :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
$c<= :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
<= :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
$c> :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
> :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
$c>= :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
>= :: TKStructuredWithWireRep -> TKStructuredWithWireRep -> Bool
$cmax :: TKStructuredWithWireRep
-> TKStructuredWithWireRep -> TKStructuredWithWireRep
max :: TKStructuredWithWireRep
-> TKStructuredWithWireRep -> TKStructuredWithWireRep
$cmin :: TKStructuredWithWireRep
-> TKStructuredWithWireRep -> TKStructuredWithWireRep
min :: TKStructuredWithWireRep
-> TKStructuredWithWireRep -> TKStructuredWithWireRep
Ord, Int -> TKStructuredWithWireRep -> ShowS
[TKStructuredWithWireRep] -> ShowS
TKStructuredWithWireRep -> String
(Int -> TKStructuredWithWireRep -> ShowS)
-> (TKStructuredWithWireRep -> String)
-> ([TKStructuredWithWireRep] -> ShowS)
-> Show TKStructuredWithWireRep
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TKStructuredWithWireRep -> ShowS
showsPrec :: Int -> TKStructuredWithWireRep -> ShowS
$cshow :: TKStructuredWithWireRep -> String
show :: TKStructuredWithWireRep -> String
$cshowList :: [TKStructuredWithWireRep] -> ShowS
showList :: [TKStructuredWithWireRep] -> ShowS
Show, Typeable)
data CanonicalizeTKWithWireRepError
= CanonicalizeStructuringError String
| CanonicalizeMissingPacketRef PacketRefId
deriving (Typeable CanonicalizeTKWithWireRepError
Typeable CanonicalizeTKWithWireRepError =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CanonicalizeTKWithWireRepError
-> c CanonicalizeTKWithWireRepError)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c CanonicalizeTKWithWireRepError)
-> (CanonicalizeTKWithWireRepError -> Constr)
-> (CanonicalizeTKWithWireRepError -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c CanonicalizeTKWithWireRepError))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CanonicalizeTKWithWireRepError))
-> ((forall b. Data b => b -> b)
-> CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError)
-> (forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CanonicalizeTKWithWireRepError
-> r)
-> (forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CanonicalizeTKWithWireRepError
-> r)
-> (forall u.
(forall d. Data d => d -> u)
-> CanonicalizeTKWithWireRepError -> [u])
-> (forall u.
Int
-> (forall d. Data d => d -> u)
-> CanonicalizeTKWithWireRepError
-> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError)
-> Data CanonicalizeTKWithWireRepError
CanonicalizeTKWithWireRepError -> Constr
CanonicalizeTKWithWireRepError -> DataType
(forall b. Data b => b -> b)
-> CanonicalizeTKWithWireRepError -> CanonicalizeTKWithWireRepError
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)
-> CanonicalizeTKWithWireRepError
-> u
forall u.
(forall d. Data d => d -> u)
-> CanonicalizeTKWithWireRepError -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CanonicalizeTKWithWireRepError
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CanonicalizeTKWithWireRepError
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c CanonicalizeTKWithWireRepError
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CanonicalizeTKWithWireRepError
-> c CanonicalizeTKWithWireRepError
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c CanonicalizeTKWithWireRepError)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CanonicalizeTKWithWireRepError)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CanonicalizeTKWithWireRepError
-> c CanonicalizeTKWithWireRepError
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CanonicalizeTKWithWireRepError
-> c CanonicalizeTKWithWireRepError
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c CanonicalizeTKWithWireRepError
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c CanonicalizeTKWithWireRepError
$ctoConstr :: CanonicalizeTKWithWireRepError -> Constr
toConstr :: CanonicalizeTKWithWireRepError -> Constr
$cdataTypeOf :: CanonicalizeTKWithWireRepError -> DataType
dataTypeOf :: CanonicalizeTKWithWireRepError -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c CanonicalizeTKWithWireRepError)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c CanonicalizeTKWithWireRepError)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CanonicalizeTKWithWireRepError)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CanonicalizeTKWithWireRepError)
$cgmapT :: (forall b. Data b => b -> b)
-> CanonicalizeTKWithWireRepError -> CanonicalizeTKWithWireRepError
gmapT :: (forall b. Data b => b -> b)
-> CanonicalizeTKWithWireRepError -> CanonicalizeTKWithWireRepError
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CanonicalizeTKWithWireRepError
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> CanonicalizeTKWithWireRepError
-> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CanonicalizeTKWithWireRepError
-> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> CanonicalizeTKWithWireRepError
-> r
$cgmapQ :: forall u.
(forall d. Data d => d -> u)
-> CanonicalizeTKWithWireRepError -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u)
-> CanonicalizeTKWithWireRepError -> [u]
$cgmapQi :: forall u.
Int
-> (forall d. Data d => d -> u)
-> CanonicalizeTKWithWireRepError
-> u
gmapQi :: forall u.
Int
-> (forall d. Data d => d -> u)
-> CanonicalizeTKWithWireRepError
-> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CanonicalizeTKWithWireRepError
-> m CanonicalizeTKWithWireRepError
Data, CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
(CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool)
-> (CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool)
-> Eq CanonicalizeTKWithWireRepError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
== :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
$c/= :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
/= :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
Eq, (forall x.
CanonicalizeTKWithWireRepError
-> Rep CanonicalizeTKWithWireRepError x)
-> (forall x.
Rep CanonicalizeTKWithWireRepError x
-> CanonicalizeTKWithWireRepError)
-> Generic CanonicalizeTKWithWireRepError
forall x.
Rep CanonicalizeTKWithWireRepError x
-> CanonicalizeTKWithWireRepError
forall x.
CanonicalizeTKWithWireRepError
-> Rep CanonicalizeTKWithWireRepError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
CanonicalizeTKWithWireRepError
-> Rep CanonicalizeTKWithWireRepError x
from :: forall x.
CanonicalizeTKWithWireRepError
-> Rep CanonicalizeTKWithWireRepError x
$cto :: forall x.
Rep CanonicalizeTKWithWireRepError x
-> CanonicalizeTKWithWireRepError
to :: forall x.
Rep CanonicalizeTKWithWireRepError x
-> CanonicalizeTKWithWireRepError
Generic, Eq CanonicalizeTKWithWireRepError
Eq CanonicalizeTKWithWireRepError =>
(CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Ordering)
-> (CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool)
-> (CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool)
-> (CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool)
-> (CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool)
-> (CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError)
-> (CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError)
-> Ord CanonicalizeTKWithWireRepError
CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Ordering
CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> CanonicalizeTKWithWireRepError
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Ordering
compare :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Ordering
$c< :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
< :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
$c<= :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
<= :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
$c> :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
> :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
$c>= :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
>= :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> Bool
$cmax :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> CanonicalizeTKWithWireRepError
max :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> CanonicalizeTKWithWireRepError
$cmin :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> CanonicalizeTKWithWireRepError
min :: CanonicalizeTKWithWireRepError
-> CanonicalizeTKWithWireRepError -> CanonicalizeTKWithWireRepError
Ord, Int -> CanonicalizeTKWithWireRepError -> ShowS
[CanonicalizeTKWithWireRepError] -> ShowS
CanonicalizeTKWithWireRepError -> String
(Int -> CanonicalizeTKWithWireRepError -> ShowS)
-> (CanonicalizeTKWithWireRepError -> String)
-> ([CanonicalizeTKWithWireRepError] -> ShowS)
-> Show CanonicalizeTKWithWireRepError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CanonicalizeTKWithWireRepError -> ShowS
showsPrec :: Int -> CanonicalizeTKWithWireRepError -> ShowS
$cshow :: CanonicalizeTKWithWireRepError -> String
show :: CanonicalizeTKWithWireRepError -> String
$cshowList :: [CanonicalizeTKWithWireRepError] -> ShowS
showList :: [CanonicalizeTKWithWireRepError] -> ShowS
Show, Typeable)
instance Ord TKUnknown where
compare :: TKUnknown -> TKUnknown -> Ordering
compare = (TKUnknown -> (SomePKPayload, Maybe SKAddendum))
-> TKUnknown -> TKUnknown -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing TKUnknown -> (SomePKPayload, Maybe SKAddendum)
_tkuKey
wireRepOfTK :: TKWithWireRep -> WireRepRef
wireRepOfTK :: TKWithWireRep -> WireRepRef
wireRepOfTK = WireRepRefs -> WireRepRef
forall a. NonEmpty a -> a
NE.head (WireRepRefs -> WireRepRef)
-> (TKWithWireRep -> WireRepRefs) -> TKWithWireRep -> WireRepRef
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TKWithWireRep -> WireRepRefs
_tkWireRepRefs
wireRepsOfTK :: TKWithWireRep -> WireRepRefs
wireRepsOfTK :: TKWithWireRep -> WireRepRefs
wireRepsOfTK = TKWithWireRep -> WireRepRefs
_tkWireRepRefs
packetRefsOfTK :: TKWithWireRep -> [PktWithWireRep]
packetRefsOfTK :: TKWithWireRep -> [PktWithWireRep]
packetRefsOfTK = TKWithWireRep -> [PktWithWireRep]
_tkPackets
packetRefIdOf :: PktWithWireRep -> PacketRefId
packetRefIdOf :: PktWithWireRep -> PacketRefId
packetRefIdOf PktWithWireRep
pkt = WireRepRef -> Int -> PacketRefId
PacketRefId (PktWithWireRep -> WireRepRef
_pktWireRepRef PktWithWireRep
pkt) (PktWithWireRep -> Int
_pktIndex PktWithWireRep
pkt)
lookupPacketRef :: TKStructuredWithWireRep -> PacketRefId -> Maybe PktWithWireRep
lookupPacketRef :: TKStructuredWithWireRep -> PacketRefId -> Maybe PktWithWireRep
lookupPacketRef TKStructuredWithWireRep
structured PacketRefId
target =
[PktWithWireRep] -> Maybe PktWithWireRep
go (TKStructuredWithWireRep -> [PktWithWireRep]
_tkStructuredPacketRefs TKStructuredWithWireRep
structured)
where
go :: [PktWithWireRep] -> Maybe PktWithWireRep
go [] = Maybe PktWithWireRep
forall a. Maybe a
Nothing
go (PktWithWireRep
pkt:[PktWithWireRep]
rest)
| PktWithWireRep -> PacketRefId
packetRefIdOf PktWithWireRep
pkt PacketRefId -> PacketRefId -> Bool
forall a. Eq a => a -> a -> Bool
== PacketRefId
target = PktWithWireRep -> Maybe PktWithWireRep
forall a. a -> Maybe a
Just PktWithWireRep
pkt
| Bool
otherwise = [PktWithWireRep] -> Maybe PktWithWireRep
go [PktWithWireRep]
rest
packetWireBytesForRef ::
TKStructuredWithWireRep
-> PacketRefId
-> Either CanonicalizeTKWithWireRepError BL.ByteString
packetWireBytesForRef :: TKStructuredWithWireRep
-> PacketRefId -> Either CanonicalizeTKWithWireRepError ByteString
packetWireBytesForRef TKStructuredWithWireRep
structured PacketRefId
refId =
case TKStructuredWithWireRep -> PacketRefId -> Maybe PktWithWireRep
lookupPacketRef TKStructuredWithWireRep
structured PacketRefId
refId of
Just PktWithWireRep
pkt -> ByteString -> Either CanonicalizeTKWithWireRepError ByteString
forall a b. b -> Either a b
Right (PktWithWireRep -> ByteString
_pktRaw PktWithWireRep
pkt)
Maybe PktWithWireRep
Nothing -> CanonicalizeTKWithWireRepError
-> Either CanonicalizeTKWithWireRepError ByteString
forall a b. a -> Either a b
Left (PacketRefId -> CanonicalizeTKWithWireRepError
CanonicalizeMissingPacketRef PacketRefId
refId)
signatureWireSortKey ::
TKStructuredWithWireRep
-> SignatureWithWireRef
-> Either CanonicalizeTKWithWireRepError (BL.ByteString, PacketRefId)
signatureWireSortKey :: TKStructuredWithWireRep
-> SignatureWithWireRef
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
signatureWireSortKey TKStructuredWithWireRep
structured SignatureWithWireRef
sig =
(\ByteString
raw -> (ByteString
raw, SignatureWithWireRef -> PacketRefId
_signatureWithWireRefRef SignatureWithWireRef
sig)) (ByteString -> (ByteString, PacketRefId))
-> Either CanonicalizeTKWithWireRepError ByteString
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
TKStructuredWithWireRep
-> PacketRefId -> Either CanonicalizeTKWithWireRepError ByteString
packetWireBytesForRef TKStructuredWithWireRep
structured (SignatureWithWireRef -> PacketRefId
_signatureWithWireRefRef SignatureWithWireRef
sig)
uidWireSortKey ::
TKStructuredWithWireRep
-> UIDWithWireRefs
-> Either CanonicalizeTKWithWireRepError (BL.ByteString, PacketRefId)
uidWireSortKey :: TKStructuredWithWireRep
-> UIDWithWireRefs
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
uidWireSortKey TKStructuredWithWireRep
structured UIDWithWireRefs
uid =
(\ByteString
raw -> (ByteString
raw, UIDWithWireRefs -> PacketRefId
_uidWithWireRefsRef UIDWithWireRefs
uid)) (ByteString -> (ByteString, PacketRefId))
-> Either CanonicalizeTKWithWireRepError ByteString
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
TKStructuredWithWireRep
-> PacketRefId -> Either CanonicalizeTKWithWireRepError ByteString
packetWireBytesForRef TKStructuredWithWireRep
structured (UIDWithWireRefs -> PacketRefId
_uidWithWireRefsRef UIDWithWireRefs
uid)
uatWireSortKey ::
TKStructuredWithWireRep
-> UATWithWireRefs
-> Either CanonicalizeTKWithWireRepError (BL.ByteString, PacketRefId)
uatWireSortKey :: TKStructuredWithWireRep
-> UATWithWireRefs
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
uatWireSortKey TKStructuredWithWireRep
structured UATWithWireRefs
uat =
(\ByteString
raw -> (ByteString
raw, UATWithWireRefs -> PacketRefId
_uatWithWireRefsRef UATWithWireRefs
uat)) (ByteString -> (ByteString, PacketRefId))
-> Either CanonicalizeTKWithWireRepError ByteString
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
TKStructuredWithWireRep
-> PacketRefId -> Either CanonicalizeTKWithWireRepError ByteString
packetWireBytesForRef TKStructuredWithWireRep
structured (UATWithWireRefs -> PacketRefId
_uatWithWireRefsRef UATWithWireRefs
uat)
subkeyWireSortKey ::
TKStructuredWithWireRep
-> SubkeyWithWireRefs
-> Either CanonicalizeTKWithWireRepError (BL.ByteString, PacketRefId)
subkeyWireSortKey :: TKStructuredWithWireRep
-> SubkeyWithWireRefs
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
subkeyWireSortKey TKStructuredWithWireRep
structured SubkeyWithWireRefs
sub =
(\ByteString
raw -> (ByteString
raw, SubkeyWithWireRefs -> PacketRefId
_subkeyWithWireRefsRef SubkeyWithWireRefs
sub)) (ByteString -> (ByteString, PacketRefId))
-> Either CanonicalizeTKWithWireRepError ByteString
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
TKStructuredWithWireRep
-> PacketRefId -> Either CanonicalizeTKWithWireRepError ByteString
packetWireBytesForRef TKStructuredWithWireRep
structured (SubkeyWithWireRefs -> PacketRefId
_subkeyWithWireRefsRef SubkeyWithWireRefs
sub)
compareSignatureWithWireRefCanonical ::
TKStructuredWithWireRep
-> SignatureWithWireRef
-> SignatureWithWireRef
-> Either CanonicalizeTKWithWireRepError Ordering
compareSignatureWithWireRefCanonical :: TKStructuredWithWireRep
-> SignatureWithWireRef
-> SignatureWithWireRef
-> Either CanonicalizeTKWithWireRepError Ordering
compareSignatureWithWireRefCanonical TKStructuredWithWireRep
structured SignatureWithWireRef
a SignatureWithWireRef
b =
(ByteString, PacketRefId) -> (ByteString, PacketRefId) -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ((ByteString, PacketRefId)
-> (ByteString, PacketRefId) -> Ordering)
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
-> Either
CanonicalizeTKWithWireRepError
((ByteString, PacketRefId) -> Ordering)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> TKStructuredWithWireRep
-> SignatureWithWireRef
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
signatureWireSortKey TKStructuredWithWireRep
structured SignatureWithWireRef
a Either
CanonicalizeTKWithWireRepError
((ByteString, PacketRefId) -> Ordering)
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
-> Either CanonicalizeTKWithWireRepError Ordering
forall a b.
Either CanonicalizeTKWithWireRepError (a -> b)
-> Either CanonicalizeTKWithWireRepError a
-> Either CanonicalizeTKWithWireRepError b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> TKStructuredWithWireRep
-> SignatureWithWireRef
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
signatureWireSortKey TKStructuredWithWireRep
structured SignatureWithWireRef
b
compareUIDWithWireRefsCanonical ::
TKStructuredWithWireRep
-> UIDWithWireRefs
-> UIDWithWireRefs
-> Either CanonicalizeTKWithWireRepError Ordering
compareUIDWithWireRefsCanonical :: TKStructuredWithWireRep
-> UIDWithWireRefs
-> UIDWithWireRefs
-> Either CanonicalizeTKWithWireRepError Ordering
compareUIDWithWireRefsCanonical TKStructuredWithWireRep
structured UIDWithWireRefs
a UIDWithWireRefs
b =
(ByteString, PacketRefId) -> (ByteString, PacketRefId) -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ((ByteString, PacketRefId)
-> (ByteString, PacketRefId) -> Ordering)
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
-> Either
CanonicalizeTKWithWireRepError
((ByteString, PacketRefId) -> Ordering)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> TKStructuredWithWireRep
-> UIDWithWireRefs
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
uidWireSortKey TKStructuredWithWireRep
structured UIDWithWireRefs
a Either
CanonicalizeTKWithWireRepError
((ByteString, PacketRefId) -> Ordering)
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
-> Either CanonicalizeTKWithWireRepError Ordering
forall a b.
Either CanonicalizeTKWithWireRepError (a -> b)
-> Either CanonicalizeTKWithWireRepError a
-> Either CanonicalizeTKWithWireRepError b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> TKStructuredWithWireRep
-> UIDWithWireRefs
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
uidWireSortKey TKStructuredWithWireRep
structured UIDWithWireRefs
b
compareUATWithWireRefsCanonical ::
TKStructuredWithWireRep
-> UATWithWireRefs
-> UATWithWireRefs
-> Either CanonicalizeTKWithWireRepError Ordering
compareUATWithWireRefsCanonical :: TKStructuredWithWireRep
-> UATWithWireRefs
-> UATWithWireRefs
-> Either CanonicalizeTKWithWireRepError Ordering
compareUATWithWireRefsCanonical TKStructuredWithWireRep
structured UATWithWireRefs
a UATWithWireRefs
b =
(ByteString, PacketRefId) -> (ByteString, PacketRefId) -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ((ByteString, PacketRefId)
-> (ByteString, PacketRefId) -> Ordering)
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
-> Either
CanonicalizeTKWithWireRepError
((ByteString, PacketRefId) -> Ordering)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> TKStructuredWithWireRep
-> UATWithWireRefs
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
uatWireSortKey TKStructuredWithWireRep
structured UATWithWireRefs
a Either
CanonicalizeTKWithWireRepError
((ByteString, PacketRefId) -> Ordering)
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
-> Either CanonicalizeTKWithWireRepError Ordering
forall a b.
Either CanonicalizeTKWithWireRepError (a -> b)
-> Either CanonicalizeTKWithWireRepError a
-> Either CanonicalizeTKWithWireRepError b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> TKStructuredWithWireRep
-> UATWithWireRefs
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
uatWireSortKey TKStructuredWithWireRep
structured UATWithWireRefs
b
compareSubkeyWithWireRefsCanonical ::
TKStructuredWithWireRep
-> SubkeyWithWireRefs
-> SubkeyWithWireRefs
-> Either CanonicalizeTKWithWireRepError Ordering
compareSubkeyWithWireRefsCanonical :: TKStructuredWithWireRep
-> SubkeyWithWireRefs
-> SubkeyWithWireRefs
-> Either CanonicalizeTKWithWireRepError Ordering
compareSubkeyWithWireRefsCanonical TKStructuredWithWireRep
structured SubkeyWithWireRefs
a SubkeyWithWireRefs
b =
(ByteString, PacketRefId) -> (ByteString, PacketRefId) -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ((ByteString, PacketRefId)
-> (ByteString, PacketRefId) -> Ordering)
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
-> Either
CanonicalizeTKWithWireRepError
((ByteString, PacketRefId) -> Ordering)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> TKStructuredWithWireRep
-> SubkeyWithWireRefs
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
subkeyWireSortKey TKStructuredWithWireRep
structured SubkeyWithWireRefs
a Either
CanonicalizeTKWithWireRepError
((ByteString, PacketRefId) -> Ordering)
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
-> Either CanonicalizeTKWithWireRepError Ordering
forall a b.
Either CanonicalizeTKWithWireRepError (a -> b)
-> Either CanonicalizeTKWithWireRepError a
-> Either CanonicalizeTKWithWireRepError b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> TKStructuredWithWireRep
-> SubkeyWithWireRefs
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
subkeyWireSortKey TKStructuredWithWireRep
structured SubkeyWithWireRefs
b
sortCanonicalByKey ::
Ord key
=> (a -> Either CanonicalizeTKWithWireRepError key)
-> [a]
-> Either CanonicalizeTKWithWireRepError [a]
sortCanonicalByKey :: forall key a.
Ord key =>
(a -> Either CanonicalizeTKWithWireRepError key)
-> [a] -> Either CanonicalizeTKWithWireRepError [a]
sortCanonicalByKey a -> Either CanonicalizeTKWithWireRepError key
keyFn [a]
xs =
((key, a) -> a) -> [(key, a)] -> [a]
forall a b. (a -> b) -> [a] -> [b]
map (key, a) -> a
forall a b. (a, b) -> b
snd ([(key, a)] -> [a])
-> ([(key, a)] -> [(key, a)]) -> [(key, a)] -> [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((key, a) -> key) -> [(key, a)] -> [(key, a)]
forall b a. Ord b => (a -> b) -> [a] -> [a]
sortOn (key, a) -> key
forall a b. (a, b) -> a
fst ([(key, a)] -> [a])
-> Either CanonicalizeTKWithWireRepError [(key, a)]
-> Either CanonicalizeTKWithWireRepError [a]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (a -> Either CanonicalizeTKWithWireRepError (key, a))
-> [a] -> Either CanonicalizeTKWithWireRepError [(key, a)]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (\a
x -> (\key
k -> (key
k, a
x)) (key -> (key, a))
-> Either CanonicalizeTKWithWireRepError key
-> Either CanonicalizeTKWithWireRepError (key, a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a -> Either CanonicalizeTKWithWireRepError key
keyFn a
x) [a]
xs
sortSignatureWithWireRefsCanonical ::
TKStructuredWithWireRep
-> [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
sortSignatureWithWireRefsCanonical :: TKStructuredWithWireRep
-> [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
sortSignatureWithWireRefsCanonical TKStructuredWithWireRep
structured =
(SignatureWithWireRef
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId))
-> [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
forall key a.
Ord key =>
(a -> Either CanonicalizeTKWithWireRepError key)
-> [a] -> Either CanonicalizeTKWithWireRepError [a]
sortCanonicalByKey (TKStructuredWithWireRep
-> SignatureWithWireRef
-> Either CanonicalizeTKWithWireRepError (ByteString, PacketRefId)
signatureWireSortKey TKStructuredWithWireRep
structured)
sortUIDWithWireRefsCanonical ::
TKStructuredWithWireRep
-> [UIDWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [UIDWithWireRefs]
sortUIDWithWireRefsCanonical :: TKStructuredWithWireRep
-> [UIDWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [UIDWithWireRefs]
sortUIDWithWireRefsCanonical TKStructuredWithWireRep
structured [UIDWithWireRefs]
uids = do
normalized <-
(UIDWithWireRefs
-> Either CanonicalizeTKWithWireRepError UIDWithWireRefs)
-> [UIDWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [UIDWithWireRefs]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse
(\UIDWithWireRefs
uid ->
(\[SignatureWithWireRef]
sigs -> UIDWithWireRefs
uid {_uidWithWireRefsSignatures = sigs}) ([SignatureWithWireRef] -> UIDWithWireRefs)
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError UIDWithWireRefs
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
TKStructuredWithWireRep
-> [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
sortSignatureWithWireRefsCanonical TKStructuredWithWireRep
structured (UIDWithWireRefs -> [SignatureWithWireRef]
_uidWithWireRefsSignatures UIDWithWireRefs
uid))
[UIDWithWireRefs]
uids
sortCanonicalByKey (uidWireSortKey structured) normalized
sortUATWithWireRefsCanonical ::
TKStructuredWithWireRep
-> [UATWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [UATWithWireRefs]
sortUATWithWireRefsCanonical :: TKStructuredWithWireRep
-> [UATWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [UATWithWireRefs]
sortUATWithWireRefsCanonical TKStructuredWithWireRep
structured [UATWithWireRefs]
uats = do
normalized <-
(UATWithWireRefs
-> Either CanonicalizeTKWithWireRepError UATWithWireRefs)
-> [UATWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [UATWithWireRefs]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse
(\UATWithWireRefs
uat ->
(\[SignatureWithWireRef]
sigs -> UATWithWireRefs
uat {_uatWithWireRefsSignatures = sigs}) ([SignatureWithWireRef] -> UATWithWireRefs)
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError UATWithWireRefs
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
TKStructuredWithWireRep
-> [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
sortSignatureWithWireRefsCanonical TKStructuredWithWireRep
structured (UATWithWireRefs -> [SignatureWithWireRef]
_uatWithWireRefsSignatures UATWithWireRefs
uat))
[UATWithWireRefs]
uats
sortCanonicalByKey (uatWireSortKey structured) normalized
sortSubkeyWithWireRefsCanonical ::
TKStructuredWithWireRep
-> [SubkeyWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [SubkeyWithWireRefs]
sortSubkeyWithWireRefsCanonical :: TKStructuredWithWireRep
-> [SubkeyWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [SubkeyWithWireRefs]
sortSubkeyWithWireRefsCanonical TKStructuredWithWireRep
structured [SubkeyWithWireRefs]
subs = do
normalized <-
(SubkeyWithWireRefs
-> Either CanonicalizeTKWithWireRepError SubkeyWithWireRefs)
-> [SubkeyWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [SubkeyWithWireRefs]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse
(\SubkeyWithWireRefs
sub ->
(\[SignatureWithWireRef]
sigs -> SubkeyWithWireRefs
sub {_subkeyWithWireRefsSignatures = sigs}) ([SignatureWithWireRef] -> SubkeyWithWireRefs)
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError SubkeyWithWireRefs
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
TKStructuredWithWireRep
-> [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
sortSignatureWithWireRefsCanonical TKStructuredWithWireRep
structured (SubkeyWithWireRefs -> [SignatureWithWireRef]
_subkeyWithWireRefsSignatures SubkeyWithWireRefs
sub))
[SubkeyWithWireRefs]
subs
sortCanonicalByKey (subkeyWireSortKey structured) normalized
canonicalizeTKStructuredWithWireRep ::
TKStructuredWithWireRep -> Either CanonicalizeTKWithWireRepError TKUnknown
canonicalizeTKStructuredWithWireRep :: TKStructuredWithWireRep
-> Either CanonicalizeTKWithWireRepError TKUnknown
canonicalizeTKStructuredWithWireRep TKStructuredWithWireRep
structured =
[SignatureWithWireRef]
-> [UIDWithWireRefs]
-> [UATWithWireRefs]
-> [SubkeyWithWireRefs]
-> TKUnknown
buildTK ([SignatureWithWireRef]
-> [UIDWithWireRefs]
-> [UATWithWireRefs]
-> [SubkeyWithWireRefs]
-> TKUnknown)
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
-> Either
CanonicalizeTKWithWireRepError
([UIDWithWireRefs]
-> [UATWithWireRefs] -> [SubkeyWithWireRefs] -> TKUnknown)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
TKStructuredWithWireRep
-> [SignatureWithWireRef]
-> Either CanonicalizeTKWithWireRepError [SignatureWithWireRef]
sortSignatureWithWireRefsCanonical TKStructuredWithWireRep
structured (TKStructuredWithWireRep -> [SignatureWithWireRef]
_tkStructuredDirectSignatures TKStructuredWithWireRep
structured) Either
CanonicalizeTKWithWireRepError
([UIDWithWireRefs]
-> [UATWithWireRefs] -> [SubkeyWithWireRefs] -> TKUnknown)
-> Either CanonicalizeTKWithWireRepError [UIDWithWireRefs]
-> Either
CanonicalizeTKWithWireRepError
([UATWithWireRefs] -> [SubkeyWithWireRefs] -> TKUnknown)
forall a b.
Either CanonicalizeTKWithWireRepError (a -> b)
-> Either CanonicalizeTKWithWireRepError a
-> Either CanonicalizeTKWithWireRepError b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
TKStructuredWithWireRep
-> [UIDWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [UIDWithWireRefs]
sortUIDWithWireRefsCanonical TKStructuredWithWireRep
structured (TKStructuredWithWireRep -> [UIDWithWireRefs]
_tkStructuredUIDs TKStructuredWithWireRep
structured) Either
CanonicalizeTKWithWireRepError
([UATWithWireRefs] -> [SubkeyWithWireRefs] -> TKUnknown)
-> Either CanonicalizeTKWithWireRepError [UATWithWireRefs]
-> Either
CanonicalizeTKWithWireRepError ([SubkeyWithWireRefs] -> TKUnknown)
forall a b.
Either CanonicalizeTKWithWireRepError (a -> b)
-> Either CanonicalizeTKWithWireRepError a
-> Either CanonicalizeTKWithWireRepError b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
TKStructuredWithWireRep
-> [UATWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [UATWithWireRefs]
sortUATWithWireRefsCanonical TKStructuredWithWireRep
structured (TKStructuredWithWireRep -> [UATWithWireRefs]
_tkStructuredUAts TKStructuredWithWireRep
structured) Either
CanonicalizeTKWithWireRepError ([SubkeyWithWireRefs] -> TKUnknown)
-> Either CanonicalizeTKWithWireRepError [SubkeyWithWireRefs]
-> Either CanonicalizeTKWithWireRepError TKUnknown
forall a b.
Either CanonicalizeTKWithWireRepError (a -> b)
-> Either CanonicalizeTKWithWireRepError a
-> Either CanonicalizeTKWithWireRepError b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
TKStructuredWithWireRep
-> [SubkeyWithWireRefs]
-> Either CanonicalizeTKWithWireRepError [SubkeyWithWireRefs]
sortSubkeyWithWireRefsCanonical TKStructuredWithWireRep
structured (TKStructuredWithWireRep -> [SubkeyWithWireRefs]
_tkStructuredSubkeys TKStructuredWithWireRep
structured)
where
buildTK :: [SignatureWithWireRef]
-> [UIDWithWireRefs]
-> [UATWithWireRefs]
-> [SubkeyWithWireRefs]
-> TKUnknown
buildTK [SignatureWithWireRef]
directSigs [UIDWithWireRefs]
uids [UATWithWireRefs]
uats [SubkeyWithWireRefs]
subs =
TKUnknown
{ _tkuKey :: (SomePKPayload, Maybe SKAddendum)
_tkuKey = TKStructuredWithWireRep -> (SomePKPayload, Maybe SKAddendum)
_tkStructuredPrimaryKey TKStructuredWithWireRep
structured
, _tkuRevs :: [SignaturePayload]
_tkuRevs = (SignatureWithWireRef -> SignaturePayload)
-> [SignatureWithWireRef] -> [SignaturePayload]
forall a b. (a -> b) -> [a] -> [b]
map SignatureWithWireRef -> SignaturePayload
_signatureWithWireRefValue [SignatureWithWireRef]
directSigs
, _tkuUIDs :: [(Text, [SignaturePayload])]
_tkuUIDs =
(UIDWithWireRefs -> (Text, [SignaturePayload]))
-> [UIDWithWireRefs] -> [(Text, [SignaturePayload])]
forall a b. (a -> b) -> [a] -> [b]
map
(UIDWithWireRefs -> Text
_uidWithWireRefsValue (UIDWithWireRefs -> Text)
-> (UIDWithWireRefs -> [SignaturePayload])
-> UIDWithWireRefs
-> (Text, [SignaturePayload])
forall b c c'. (b -> c) -> (b -> c') -> b -> (c, c')
forall (a :: * -> * -> *) b c c'.
Arrow a =>
a b c -> a b c' -> a b (c, c')
&&&
((SignatureWithWireRef -> SignaturePayload)
-> [SignatureWithWireRef] -> [SignaturePayload]
forall a b. (a -> b) -> [a] -> [b]
map SignatureWithWireRef -> SignaturePayload
_signatureWithWireRefValue ([SignatureWithWireRef] -> [SignaturePayload])
-> (UIDWithWireRefs -> [SignatureWithWireRef])
-> UIDWithWireRefs
-> [SignaturePayload]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UIDWithWireRefs -> [SignatureWithWireRef]
_uidWithWireRefsSignatures))
[UIDWithWireRefs]
uids
, _tkuUAts :: [([UserAttrSubPacket], [SignaturePayload])]
_tkuUAts =
(UATWithWireRefs -> ([UserAttrSubPacket], [SignaturePayload]))
-> [UATWithWireRefs] -> [([UserAttrSubPacket], [SignaturePayload])]
forall a b. (a -> b) -> [a] -> [b]
map
(UATWithWireRefs -> [UserAttrSubPacket]
_uatWithWireRefsValue (UATWithWireRefs -> [UserAttrSubPacket])
-> (UATWithWireRefs -> [SignaturePayload])
-> UATWithWireRefs
-> ([UserAttrSubPacket], [SignaturePayload])
forall b c c'. (b -> c) -> (b -> c') -> b -> (c, c')
forall (a :: * -> * -> *) b c c'.
Arrow a =>
a b c -> a b c' -> a b (c, c')
&&&
((SignatureWithWireRef -> SignaturePayload)
-> [SignatureWithWireRef] -> [SignaturePayload]
forall a b. (a -> b) -> [a] -> [b]
map SignatureWithWireRef -> SignaturePayload
_signatureWithWireRefValue ([SignatureWithWireRef] -> [SignaturePayload])
-> (UATWithWireRefs -> [SignatureWithWireRef])
-> UATWithWireRefs
-> [SignaturePayload]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UATWithWireRefs -> [SignatureWithWireRef]
_uatWithWireRefsSignatures))
[UATWithWireRefs]
uats
, _tkuSubs :: [(Pkt, [SignaturePayload])]
_tkuSubs =
(SubkeyWithWireRefs -> (Pkt, [SignaturePayload]))
-> [SubkeyWithWireRefs] -> [(Pkt, [SignaturePayload])]
forall a b. (a -> b) -> [a] -> [b]
map
(SubkeyWithWireRefs -> Pkt
_subkeyWithWireRefsValue (SubkeyWithWireRefs -> Pkt)
-> (SubkeyWithWireRefs -> [SignaturePayload])
-> SubkeyWithWireRefs
-> (Pkt, [SignaturePayload])
forall b c c'. (b -> c) -> (b -> c') -> b -> (c, c')
forall (a :: * -> * -> *) b c c'.
Arrow a =>
a b c -> a b c' -> a b (c, c')
&&&
((SignatureWithWireRef -> SignaturePayload)
-> [SignatureWithWireRef] -> [SignaturePayload]
forall a b. (a -> b) -> [a] -> [b]
map SignatureWithWireRef -> SignaturePayload
_signatureWithWireRefValue ([SignatureWithWireRef] -> [SignaturePayload])
-> (SubkeyWithWireRefs -> [SignatureWithWireRef])
-> SubkeyWithWireRefs
-> [SignaturePayload]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SubkeyWithWireRefs -> [SignatureWithWireRef]
_subkeyWithWireRefsSignatures))
[SubkeyWithWireRefs]
subs
}
canonicalizeTKWithWireRep ::
TKWithWireRep -> Either CanonicalizeTKWithWireRepError TKUnknown
canonicalizeTKWithWireRep :: TKWithWireRep -> Either CanonicalizeTKWithWireRepError TKUnknown
canonicalizeTKWithWireRep TKWithWireRep
tk = do
structured <-
case TKWithWireRep -> Either String TKStructuredWithWireRep
toStructuredTKWithWireRep TKWithWireRep
tk of
Left String
err -> CanonicalizeTKWithWireRepError
-> Either CanonicalizeTKWithWireRepError TKStructuredWithWireRep
forall a b. a -> Either a b
Left (String -> CanonicalizeTKWithWireRepError
CanonicalizeStructuringError String
err)
Right TKStructuredWithWireRep
s -> TKStructuredWithWireRep
-> Either CanonicalizeTKWithWireRepError TKStructuredWithWireRep
forall a b. b -> Either a b
Right TKStructuredWithWireRep
s
canonicalizeTKStructuredWithWireRep structured
toStructuredTKWithWireRep :: TKWithWireRep -> Either String TKStructuredWithWireRep
toStructuredTKWithWireRep :: TKWithWireRep -> Either String TKStructuredWithWireRep
toStructuredTKWithWireRep TKWithWireRep
tkWithRefs = do
let tk :: TKUnknown
tk = TKWithWireRep -> TKUnknown
_tkValue TKWithWireRep
tkWithRefs
refs :: [PktWithWireRep]
refs = TKWithWireRep -> [PktWithWireRep]
_tkPackets TKWithWireRep
tkWithRefs
(SomePKPayload
pkp, Maybe SKAddendum
mska) = TKUnknown -> (SomePKPayload, Maybe SKAddendum)
_tkuKey TKUnknown
tk
primaryPkt :: Pkt
primaryPkt = SomeKeyPkt -> Pkt
someKeyPktToPkt (SomePKPayload -> Maybe SKAddendum -> SomeKeyPkt
mkPrimaryKeyPkt SomePKPayload
pkp Maybe SKAddendum
mska)
zipper <- case [PktWithWireRep] -> Maybe PacketZipper
zFromList [PktWithWireRep]
refs of
Just PacketZipper
z -> PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z
Maybe PacketZipper
Nothing -> String -> Either String PacketZipper
forall a b. a -> Either a b
Left String
"no packet references available for TKUnknown structuring"
(primaryRef, z1') <- consumePktZ "primary key packet" primaryPkt zipper
z1 <- case zMoveNext z1' of
Just PacketZipper
z -> PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z
Maybe PacketZipper
Nothing ->
if [SignaturePayload] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null (TKUnknown -> [SignaturePayload]
_tkuRevs TKUnknown
tk) Bool -> Bool -> Bool
&& [(Text, [SignaturePayload])] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null (TKUnknown -> [(Text, [SignaturePayload])]
_tkuUIDs TKUnknown
tk) Bool -> Bool -> Bool
&& [([UserAttrSubPacket], [SignaturePayload])] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null (TKUnknown -> [([UserAttrSubPacket], [SignaturePayload])]
_tkuUAts TKUnknown
tk) Bool -> Bool -> Bool
&& [(Pkt, [SignaturePayload])] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null (TKUnknown -> [(Pkt, [SignaturePayload])]
_tkuSubs TKUnknown
tk)
then PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z1'
else String -> Either String PacketZipper
forall a b. a -> Either a b
Left String
"missing signatures/UIDs/subkeys after primary key packet"
(directSigs, z2) <- consumeSigsZ "direct-key signatures" (_tkuRevs tk) z1
(uids, z3) <- consumeUIDsZ (_tkuUIDs tk) z2
(uats, z4) <- consumeUATsZ (_tkuUAts tk) z3
(subs, z5) <- consumeSubsZ (_tkuSubs tk) z4
case _zpAfter z5 of
[] ->
TKStructuredWithWireRep -> Either String TKStructuredWithWireRep
forall a b. b -> Either a b
Right
(WireRepRefs
-> Maybe ByteRange
-> (SomePKPayload, Maybe SKAddendum)
-> PacketRefId
-> [SignatureWithWireRef]
-> [UIDWithWireRefs]
-> [UATWithWireRefs]
-> [SubkeyWithWireRefs]
-> [PktWithWireRep]
-> TKStructuredWithWireRep
TKStructuredWithWireRep
(TKWithWireRep -> WireRepRefs
_tkWireRepRefs TKWithWireRep
tkWithRefs)
(TKWithWireRep -> Maybe ByteRange
_tkWireRepRange TKWithWireRep
tkWithRefs)
(TKUnknown -> (SomePKPayload, Maybe SKAddendum)
_tkuKey TKUnknown
tk)
(PktWithWireRep -> PacketRefId
packetRefIdOf PktWithWireRep
primaryRef)
[SignatureWithWireRef]
directSigs
[UIDWithWireRefs]
uids
[UATWithWireRefs]
uats
[SubkeyWithWireRefs]
subs
(TKWithWireRep -> [PktWithWireRep]
_tkPackets TKWithWireRep
tkWithRefs))
(PktWithWireRep
unexpected:[PktWithWireRep]
_) ->
String -> Either String TKStructuredWithWireRep
forall a b. a -> Either a b
Left
(String
"unexpected trailing packet reference at position " String -> ShowS
forall a. [a] -> [a] -> [a]
++
Int -> String
forall a. Show a => a -> String
show (PacketZipper -> Int
zPosition PacketZipper
z5 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
1) String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
" while structuring TKUnknown provenance (tag " String -> ShowS
forall a. [a] -> [a] -> [a]
++
Word8 -> String
forall a. Show a => a -> String
show (Pkt -> Word8
pktTag (PktWithWireRep -> Pkt
_pktValue PktWithWireRep
unexpected)) String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
")")
where
consumePktZ :: String -> Pkt -> PacketZipper -> Either String (PktWithWireRep, PacketZipper)
consumePktZ :: String
-> Pkt
-> PacketZipper
-> Either String (PktWithWireRep, PacketZipper)
consumePktZ String
context Pkt
expected PacketZipper
z
| PktWithWireRep -> Pkt
_pktValue (PacketZipper -> PktWithWireRep
_zpCurrent PacketZipper
z) Pkt -> Pkt -> Bool
forall a. Eq a => a -> a -> Bool
== Pkt
expected = (PktWithWireRep, PacketZipper)
-> Either String (PktWithWireRep, PacketZipper)
forall a b. b -> Either a b
Right (PacketZipper -> PktWithWireRep
_zpCurrent PacketZipper
z, PacketZipper
z)
| Bool
otherwise =
String -> Either String (PktWithWireRep, PacketZipper)
forall a b. a -> Either a b
Left
(String
"packet/reference mismatch for " String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
context String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
" at position " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (PacketZipper -> Int
zPosition PacketZipper
z) String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
": expected tag " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Word8 -> String
forall a. Show a => a -> String
show (Pkt -> Word8
pktTag Pkt
expected) String -> ShowS
forall a. [a] -> [a] -> [a]
++
String
", got tag " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Word8 -> String
forall a. Show a => a -> String
show (Pkt -> Word8
pktTag (PktWithWireRep -> Pkt
_pktValue (PacketZipper -> PktWithWireRep
_zpCurrent PacketZipper
z))))
consumeSigsZ ::
String
-> [SignaturePayload]
-> PacketZipper
-> Either String ([SignatureWithWireRef], PacketZipper)
consumeSigsZ :: String
-> [SignaturePayload]
-> PacketZipper
-> Either String ([SignatureWithWireRef], PacketZipper)
consumeSigsZ String
context [SignaturePayload]
sigs PacketZipper
z = [SignatureWithWireRef]
-> [SignaturePayload]
-> PacketZipper
-> Either String ([SignatureWithWireRef], PacketZipper)
go [] [SignaturePayload]
sigs PacketZipper
z
where
go :: [SignatureWithWireRef]
-> [SignaturePayload]
-> PacketZipper
-> Either String ([SignatureWithWireRef], PacketZipper)
go [SignatureWithWireRef]
acc [] PacketZipper
zipper = ([SignatureWithWireRef], PacketZipper)
-> Either String ([SignatureWithWireRef], PacketZipper)
forall a b. b -> Either a b
Right ([SignatureWithWireRef] -> [SignatureWithWireRef]
forall a. [a] -> [a]
reverse [SignatureWithWireRef]
acc, PacketZipper
zipper)
go [SignatureWithWireRef]
acc (SignaturePayload
sig:[SignaturePayload]
sigRest) PacketZipper
zipper = do
(sigPkt, z') <- String
-> Pkt
-> PacketZipper
-> Either String (PktWithWireRep, PacketZipper)
consumePktZ String
context (SignaturePayload -> Pkt
SignaturePkt SignaturePayload
sig) PacketZipper
zipper
z'' <- case zMoveNext z' of
Just PacketZipper
z -> PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z
Maybe PacketZipper
Nothing -> if [SignaturePayload] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [SignaturePayload]
sigRest then PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z' else String -> Either String PacketZipper
forall a b. a -> Either a b
Left (String
"missing signature packet at position " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (PacketZipper -> Int
zPosition PacketZipper
z'))
go
(SignatureWithWireRef sig (packetRefIdOf sigPkt) : acc)
sigRest
z''
consumeUIDsZ ::
[(Text, [SignaturePayload])]
-> PacketZipper
-> Either String ([UIDWithWireRefs], PacketZipper)
consumeUIDsZ :: [(Text, [SignaturePayload])]
-> PacketZipper -> Either String ([UIDWithWireRefs], PacketZipper)
consumeUIDsZ [] PacketZipper
z = ([UIDWithWireRefs], PacketZipper)
-> Either String ([UIDWithWireRefs], PacketZipper)
forall a b. b -> Either a b
Right ([], PacketZipper
z)
consumeUIDsZ ((Text
uid, [SignaturePayload]
sigs):[(Text, [SignaturePayload])]
rest) PacketZipper
z = do
(uidPkt, z1) <- String
-> Pkt
-> PacketZipper
-> Either String (PktWithWireRep, PacketZipper)
consumePktZ String
"UID packet" (Text -> Pkt
UserIdPkt Text
uid) PacketZipper
z
z2 <- case zMoveNext z1 of
Just PacketZipper
z -> PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z
Maybe PacketZipper
Nothing -> if [(Text, [SignaturePayload])] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [(Text, [SignaturePayload])]
rest Bool -> Bool -> Bool
&& [SignaturePayload] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [SignaturePayload]
sigs then PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z1 else String -> Either String PacketZipper
forall a b. a -> Either a b
Left (String
"missing UID at position " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (PacketZipper -> Int
zPosition PacketZipper
z1))
(uidSigs, z3) <- consumeSigsZ "UID signature" sigs z2
(tailUIDs, z4) <- consumeUIDsZ rest z3
Right
(UIDWithWireRefs uid (packetRefIdOf uidPkt) uidSigs : tailUIDs, z4)
consumeUATsZ ::
[([UserAttrSubPacket], [SignaturePayload])]
-> PacketZipper
-> Either String ([UATWithWireRefs], PacketZipper)
consumeUATsZ :: [([UserAttrSubPacket], [SignaturePayload])]
-> PacketZipper -> Either String ([UATWithWireRefs], PacketZipper)
consumeUATsZ [] PacketZipper
z = ([UATWithWireRefs], PacketZipper)
-> Either String ([UATWithWireRefs], PacketZipper)
forall a b. b -> Either a b
Right ([], PacketZipper
z)
consumeUATsZ (([UserAttrSubPacket]
uat, [SignaturePayload]
sigs):[([UserAttrSubPacket], [SignaturePayload])]
rest) PacketZipper
z = do
(uatPkt, z1) <- String
-> Pkt
-> PacketZipper
-> Either String (PktWithWireRep, PacketZipper)
consumePktZ String
"UAT packet" ([UserAttrSubPacket] -> Pkt
UserAttributePkt [UserAttrSubPacket]
uat) PacketZipper
z
z2 <- case zMoveNext z1 of
Just PacketZipper
z -> PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z
Maybe PacketZipper
Nothing -> if [([UserAttrSubPacket], [SignaturePayload])] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [([UserAttrSubPacket], [SignaturePayload])]
rest Bool -> Bool -> Bool
&& [SignaturePayload] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [SignaturePayload]
sigs then PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z1 else String -> Either String PacketZipper
forall a b. a -> Either a b
Left (String
"missing UAT at position " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (PacketZipper -> Int
zPosition PacketZipper
z1))
(uatSigs, z3) <- consumeSigsZ "UAT signature" sigs z2
(tailUats, z4) <- consumeUATsZ rest z3
Right
(UATWithWireRefs uat (packetRefIdOf uatPkt) uatSigs : tailUats, z4)
consumeSubsZ ::
[(Pkt, [SignaturePayload])]
-> PacketZipper
-> Either String ([SubkeyWithWireRefs], PacketZipper)
consumeSubsZ :: [(Pkt, [SignaturePayload])]
-> PacketZipper
-> Either String ([SubkeyWithWireRefs], PacketZipper)
consumeSubsZ [] PacketZipper
z = ([SubkeyWithWireRefs], PacketZipper)
-> Either String ([SubkeyWithWireRefs], PacketZipper)
forall a b. b -> Either a b
Right ([], PacketZipper
z)
consumeSubsZ ((Pkt
subPkt, [SignaturePayload]
sigs):[(Pkt, [SignaturePayload])]
rest) PacketZipper
z = do
(subRef, z1) <- String
-> Pkt
-> PacketZipper
-> Either String (PktWithWireRep, PacketZipper)
consumePktZ String
"subkey packet" Pkt
subPkt PacketZipper
z
z2 <- case zMoveNext z1 of
Just PacketZipper
z -> PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z
Maybe PacketZipper
Nothing -> if [(Pkt, [SignaturePayload])] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [(Pkt, [SignaturePayload])]
rest Bool -> Bool -> Bool
&& [SignaturePayload] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [SignaturePayload]
sigs then PacketZipper -> Either String PacketZipper
forall a b. b -> Either a b
Right PacketZipper
z1 else String -> Either String PacketZipper
forall a b. a -> Either a b
Left (String
"missing subkey at position " String -> ShowS
forall a. [a] -> [a] -> [a]
++ Int -> String
forall a. Show a => a -> String
show (PacketZipper -> Int
zPosition PacketZipper
z1))
(subSigs, z3) <- consumeSigsZ "subkey signature" sigs z2
(tailSubs, z4) <- consumeSubsZ rest z3
Right
(SubkeyWithWireRefs subPkt (packetRefIdOf subRef) subSigs : tailSubs, z4)
tksFromWireRep :: WireRepRef -> [TKWithWireRep] -> [TKWithWireRep]
tksFromWireRep :: WireRepRef -> [TKWithWireRep] -> [TKWithWireRep]
tksFromWireRep WireRepRef
src = (TKWithWireRep -> Bool) -> [TKWithWireRep] -> [TKWithWireRep]
forall a. (a -> Bool) -> [a] -> [a]
filter (WireRepRef -> [WireRepRef] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
elem WireRepRef
src ([WireRepRef] -> Bool)
-> (TKWithWireRep -> [WireRepRef]) -> TKWithWireRep -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WireRepRefs -> [WireRepRef]
forall a. NonEmpty a -> [a]
NE.toList (WireRepRefs -> [WireRepRef])
-> (TKWithWireRep -> WireRepRefs) -> TKWithWireRep -> [WireRepRef]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TKWithWireRep -> WireRepRefs
wireRepsOfTK)
tksContainingPacket :: PktWithWireRep -> [TKWithWireRep] -> [TKWithWireRep]
tksContainingPacket :: PktWithWireRep -> [TKWithWireRep] -> [TKWithWireRep]
tksContainingPacket PktWithWireRep
pkt = (TKWithWireRep -> Bool) -> [TKWithWireRep] -> [TKWithWireRep]
forall a. (a -> Bool) -> [a] -> [a]
filter (PktWithWireRep -> [PktWithWireRep] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
elem PktWithWireRep
pkt ([PktWithWireRep] -> Bool)
-> (TKWithWireRep -> [PktWithWireRep]) -> TKWithWireRep -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TKWithWireRep -> [PktWithWireRep]
packetRefsOfTK)
$(ATH.deriveToJSON ATH.defaultOptions ''TKUnknown)
type KeyringIxs = '[ EightOctetKeyId, Fingerprint, Text]
type PublicKeyring = IxSet KeyringIxs (TK 'PublicTK)
type SecretKeyring = IxSet KeyringIxs (TK 'SecretTK)
type family KeyringOf (k :: TKKind) :: Type where
KeyringOf 'PublicTK = PublicKeyring
KeyringOf 'SecretTK = SecretKeyring
$(makeLenses ''TKUnknown)
$(makeLenses ''TK)
$(makeLenses ''TKWithWireRep)
$(makeLenses ''PacketRefId)
$(makeLenses ''PacketZipper)
$(makeLenses ''SignatureWithWireRef)
$(makeLenses ''UIDWithWireRefs)
$(makeLenses ''UATWithWireRefs)
$(makeLenses ''SubkeyWithWireRefs)
$(makeLenses ''TKStructuredWithWireRep)