-- Base.hs: OpenPGP (RFC4880) data types
-- Copyright © 2012-2018  Clint Adams
-- This software is released under the terms of the Expat license.
-- (See the LICENSE file).
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}

module Codec.Encryption.OpenPGP.Types.Internal.Base where

import GHC.Generics (Generic)

import Codec.Encryption.OpenPGP.Types.Internal.PrettyUtils (prettyLBS)
import Control.Applicative ((<|>))
import Control.Arrow ((***))
import Control.Lens (makeLenses)
import Control.Monad (mzero)
import Control.Newtype (Newtype(..))
import Data.Aeson ((.=), object)
import qualified Data.Aeson as A
import qualified Data.Aeson.TH as ATH
import Data.ByteArray (ByteArrayAccess)
import qualified Data.ByteString as B
import qualified Data.ByteString.Base16.Lazy as B16L
import Data.ByteString.Lazy (ByteString)
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Lazy.Char8 as BLC8
import Data.Char (toLower, toUpper)
import Data.Data (Data)
import Data.Hashable (Hashable(..))
import Data.List (unfoldr)
import Data.List.NonEmpty (NonEmpty)
import qualified Data.List.NonEmpty as NE
import Data.List.Split (chunksOf)
import Data.Maybe (fromMaybe)
import Data.Monoid ((<>))
import Data.Ord (comparing)
import Data.Semigroup (Semigroup)
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Text (Text)
import qualified Data.Text as T
import Data.Text.Prettyprint.Doc (Pretty(..), (<+>), hsep, punctuate, space)
import Data.Time.Clock.POSIX (posixSecondsToUTCTime)
import Data.Time.Format (formatTime)
import Data.Time.Locale.Compat (defaultTimeLocale)
import Data.Typeable (Typeable)
import Data.Word (Word16, Word32, Word8)
import Network.URI (URI(..), nullURI, parseURI, uriToString)
import Numeric (readHex)

type Exportability = Bool

type TrustLevel = Word8

type TrustAmount = Word8

type AlmostPublicDomainRegex = ByteString

type Revocability = Bool

type RevocationReason = Text

type KeyServer = ByteString

type SignatureHash = ByteString

type PacketVersion = Word8

type V3Expiration = Word16

type CompressedDataPayload = ByteString

type FileName = ByteString

type ImageData = ByteString

type NestedFlag = Bool

class (Eq a, Ord a) =>
      FutureFlag a
  where
  fromFFlag :: a -> Int
  toFFlag :: Int -> a

class (Eq a, Ord a) =>
      FutureVal a
  where
  fromFVal :: a -> Word8
  toFVal :: Word8 -> a

data SymmetricAlgorithm
  = Plaintext
  | IDEA
  | TripleDES
  | CAST5
  | Blowfish
  | ReservedSAFER
  | ReservedDES
  | AES128
  | AES192
  | AES256
  | Twofish
  | Camellia128
  | Camellia192
  | Camellia256
  | OtherSA Word8
  deriving (Typeable SymmetricAlgorithm
Constr
DataType
Typeable SymmetricAlgorithm =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> SymmetricAlgorithm
 -> c SymmetricAlgorithm)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SymmetricAlgorithm)
-> (SymmetricAlgorithm -> Constr)
-> (SymmetricAlgorithm -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SymmetricAlgorithm))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c SymmetricAlgorithm))
-> ((forall b. Data b => b -> b)
    -> SymmetricAlgorithm -> SymmetricAlgorithm)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SymmetricAlgorithm -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SymmetricAlgorithm -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> SymmetricAlgorithm -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SymmetricAlgorithm -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> SymmetricAlgorithm -> m SymmetricAlgorithm)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SymmetricAlgorithm -> m SymmetricAlgorithm)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SymmetricAlgorithm -> m SymmetricAlgorithm)
-> Data SymmetricAlgorithm
SymmetricAlgorithm -> Constr
SymmetricAlgorithm -> DataType
(forall b. Data b => b -> b)
-> SymmetricAlgorithm -> SymmetricAlgorithm
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymmetricAlgorithm
-> c SymmetricAlgorithm
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymmetricAlgorithm
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) -> SymmetricAlgorithm -> u
forall u. (forall d. Data d => d -> u) -> SymmetricAlgorithm -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymmetricAlgorithm -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymmetricAlgorithm -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SymmetricAlgorithm -> m SymmetricAlgorithm
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymmetricAlgorithm -> m SymmetricAlgorithm
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymmetricAlgorithm
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymmetricAlgorithm
-> c SymmetricAlgorithm
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SymmetricAlgorithm)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SymmetricAlgorithm)
$cOtherSA :: Constr
$cCamellia256 :: Constr
$cCamellia192 :: Constr
$cCamellia128 :: Constr
$cTwofish :: Constr
$cAES256 :: Constr
$cAES192 :: Constr
$cAES128 :: Constr
$cReservedDES :: Constr
$cReservedSAFER :: Constr
$cBlowfish :: Constr
$cCAST5 :: Constr
$cTripleDES :: Constr
$cIDEA :: Constr
$cPlaintext :: Constr
$tSymmetricAlgorithm :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> SymmetricAlgorithm -> m SymmetricAlgorithm
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymmetricAlgorithm -> m SymmetricAlgorithm
gmapMp :: (forall d. Data d => d -> m d)
-> SymmetricAlgorithm -> m SymmetricAlgorithm
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SymmetricAlgorithm -> m SymmetricAlgorithm
gmapM :: (forall d. Data d => d -> m d)
-> SymmetricAlgorithm -> m SymmetricAlgorithm
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SymmetricAlgorithm -> m SymmetricAlgorithm
gmapQi :: Int -> (forall d. Data d => d -> u) -> SymmetricAlgorithm -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SymmetricAlgorithm -> u
gmapQ :: (forall d. Data d => d -> u) -> SymmetricAlgorithm -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SymmetricAlgorithm -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymmetricAlgorithm -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SymmetricAlgorithm -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymmetricAlgorithm -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SymmetricAlgorithm -> r
gmapT :: (forall b. Data b => b -> b)
-> SymmetricAlgorithm -> SymmetricAlgorithm
$cgmapT :: (forall b. Data b => b -> b)
-> SymmetricAlgorithm -> SymmetricAlgorithm
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SymmetricAlgorithm)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SymmetricAlgorithm)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c SymmetricAlgorithm)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SymmetricAlgorithm)
dataTypeOf :: SymmetricAlgorithm -> DataType
$cdataTypeOf :: SymmetricAlgorithm -> DataType
toConstr :: SymmetricAlgorithm -> Constr
$ctoConstr :: SymmetricAlgorithm -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymmetricAlgorithm
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SymmetricAlgorithm
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymmetricAlgorithm
-> c SymmetricAlgorithm
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SymmetricAlgorithm
-> c SymmetricAlgorithm
$cp1Data :: Typeable SymmetricAlgorithm
Data, (forall x. SymmetricAlgorithm -> Rep SymmetricAlgorithm x)
-> (forall x. Rep SymmetricAlgorithm x -> SymmetricAlgorithm)
-> Generic SymmetricAlgorithm
forall x. Rep SymmetricAlgorithm x -> SymmetricAlgorithm
forall x. SymmetricAlgorithm -> Rep SymmetricAlgorithm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SymmetricAlgorithm x -> SymmetricAlgorithm
$cfrom :: forall x. SymmetricAlgorithm -> Rep SymmetricAlgorithm x
Generic, Int -> SymmetricAlgorithm -> ShowS
[SymmetricAlgorithm] -> ShowS
SymmetricAlgorithm -> String
(Int -> SymmetricAlgorithm -> ShowS)
-> (SymmetricAlgorithm -> String)
-> ([SymmetricAlgorithm] -> ShowS)
-> Show SymmetricAlgorithm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SymmetricAlgorithm] -> ShowS
$cshowList :: [SymmetricAlgorithm] -> ShowS
show :: SymmetricAlgorithm -> String
$cshow :: SymmetricAlgorithm -> String
showsPrec :: Int -> SymmetricAlgorithm -> ShowS
$cshowsPrec :: Int -> SymmetricAlgorithm -> ShowS
Show, Typeable)

instance Eq SymmetricAlgorithm where
  == :: SymmetricAlgorithm -> SymmetricAlgorithm -> Bool
(==) a :: SymmetricAlgorithm
a b :: SymmetricAlgorithm
b = SymmetricAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal SymmetricAlgorithm
a Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
== SymmetricAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal SymmetricAlgorithm
b

instance Ord SymmetricAlgorithm where
  compare :: SymmetricAlgorithm -> SymmetricAlgorithm -> Ordering
compare = (SymmetricAlgorithm -> Word8)
-> SymmetricAlgorithm -> SymmetricAlgorithm -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing SymmetricAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal

instance FutureVal SymmetricAlgorithm where
  fromFVal :: SymmetricAlgorithm -> Word8
fromFVal Plaintext = 0
  fromFVal IDEA = 1
  fromFVal TripleDES = 2
  fromFVal CAST5 = 3
  fromFVal Blowfish = 4
  fromFVal ReservedSAFER = 5
  fromFVal ReservedDES = 6
  fromFVal AES128 = 7
  fromFVal AES192 = 8
  fromFVal AES256 = 9
  fromFVal Twofish = 10
  fromFVal Camellia128 = 11
  fromFVal Camellia192 = 12
  fromFVal Camellia256 = 13
  fromFVal (OtherSA o :: Word8
o) = Word8
o
  toFVal :: Word8 -> SymmetricAlgorithm
toFVal 0 = SymmetricAlgorithm
Plaintext
  toFVal 1 = SymmetricAlgorithm
IDEA
  toFVal 2 = SymmetricAlgorithm
TripleDES
  toFVal 3 = SymmetricAlgorithm
CAST5
  toFVal 4 = SymmetricAlgorithm
Blowfish
  toFVal 5 = SymmetricAlgorithm
ReservedSAFER
  toFVal 6 = SymmetricAlgorithm
ReservedDES
  toFVal 7 = SymmetricAlgorithm
AES128
  toFVal 8 = SymmetricAlgorithm
AES192
  toFVal 9 = SymmetricAlgorithm
AES256
  toFVal 10 = SymmetricAlgorithm
Twofish
  toFVal 11 = SymmetricAlgorithm
Camellia128
  toFVal 12 = SymmetricAlgorithm
Camellia192
  toFVal 13 = SymmetricAlgorithm
Camellia256
  toFVal o :: Word8
o = Word8 -> SymmetricAlgorithm
OtherSA Word8
o

instance Hashable SymmetricAlgorithm

instance Pretty SymmetricAlgorithm where
  pretty :: SymmetricAlgorithm -> Doc ann
pretty Plaintext = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "plaintext"
  pretty IDEA = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "IDEA"
  pretty TripleDES = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "3DES"
  pretty CAST5 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "CAST-128"
  pretty Blowfish = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "Blowfish"
  pretty ReservedSAFER = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "(reserved) SAFER"
  pretty ReservedDES = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "(reserved) DES"
  pretty AES128 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "AES-128"
  pretty AES192 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "AES-192"
  pretty AES256 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "AES-256"
  pretty Twofish = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "Twofish"
  pretty Camellia128 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "Camellia-128"
  pretty Camellia192 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "Camellia-192"
  pretty Camellia256 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "Camellia-256"
  pretty (OtherSA sa :: Word8
sa) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown symmetric algorithm" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
sa

$(ATH.deriveJSON ATH.defaultOptions ''SymmetricAlgorithm)

data NotationFlag
  = HumanReadable
  | OtherNF Word8 -- FIXME: this should be constrained to 4 bits?
  deriving (Typeable NotationFlag
Constr
DataType
Typeable NotationFlag =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> NotationFlag -> c NotationFlag)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c NotationFlag)
-> (NotationFlag -> Constr)
-> (NotationFlag -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c NotationFlag))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c NotationFlag))
-> ((forall b. Data b => b -> b) -> NotationFlag -> NotationFlag)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> NotationFlag -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> NotationFlag -> r)
-> (forall u. (forall d. Data d => d -> u) -> NotationFlag -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> NotationFlag -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag)
-> Data NotationFlag
NotationFlag -> Constr
NotationFlag -> DataType
(forall b. Data b => b -> b) -> NotationFlag -> NotationFlag
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationFlag -> c NotationFlag
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationFlag
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) -> NotationFlag -> u
forall u. (forall d. Data d => d -> u) -> NotationFlag -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NotationFlag -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NotationFlag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationFlag
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationFlag -> c NotationFlag
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NotationFlag)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NotationFlag)
$cOtherNF :: Constr
$cHumanReadable :: Constr
$tNotationFlag :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag
gmapMp :: (forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag
gmapM :: (forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NotationFlag -> m NotationFlag
gmapQi :: Int -> (forall d. Data d => d -> u) -> NotationFlag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NotationFlag -> u
gmapQ :: (forall d. Data d => d -> u) -> NotationFlag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> NotationFlag -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NotationFlag -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NotationFlag -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NotationFlag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NotationFlag -> r
gmapT :: (forall b. Data b => b -> b) -> NotationFlag -> NotationFlag
$cgmapT :: (forall b. Data b => b -> b) -> NotationFlag -> NotationFlag
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NotationFlag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NotationFlag)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c NotationFlag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NotationFlag)
dataTypeOf :: NotationFlag -> DataType
$cdataTypeOf :: NotationFlag -> DataType
toConstr :: NotationFlag -> Constr
$ctoConstr :: NotationFlag -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationFlag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationFlag
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationFlag -> c NotationFlag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationFlag -> c NotationFlag
$cp1Data :: Typeable NotationFlag
Data, (forall x. NotationFlag -> Rep NotationFlag x)
-> (forall x. Rep NotationFlag x -> NotationFlag)
-> Generic NotationFlag
forall x. Rep NotationFlag x -> NotationFlag
forall x. NotationFlag -> Rep NotationFlag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NotationFlag x -> NotationFlag
$cfrom :: forall x. NotationFlag -> Rep NotationFlag x
Generic, Int -> NotationFlag -> ShowS
[NotationFlag] -> ShowS
NotationFlag -> String
(Int -> NotationFlag -> ShowS)
-> (NotationFlag -> String)
-> ([NotationFlag] -> ShowS)
-> Show NotationFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotationFlag] -> ShowS
$cshowList :: [NotationFlag] -> ShowS
show :: NotationFlag -> String
$cshow :: NotationFlag -> String
showsPrec :: Int -> NotationFlag -> ShowS
$cshowsPrec :: Int -> NotationFlag -> ShowS
Show, Typeable)

instance Eq NotationFlag where
  == :: NotationFlag -> NotationFlag -> Bool
(==) a :: NotationFlag
a b :: NotationFlag
b = NotationFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag NotationFlag
a Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== NotationFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag NotationFlag
b

instance Ord NotationFlag where
  compare :: NotationFlag -> NotationFlag -> Ordering
compare = (NotationFlag -> Int) -> NotationFlag -> NotationFlag -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing NotationFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag

instance FutureFlag NotationFlag where
  fromFFlag :: NotationFlag -> Int
fromFFlag HumanReadable = 0
  fromFFlag (OtherNF o :: Word8
o) = Word8 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
o
  toFFlag :: Int -> NotationFlag
toFFlag 0 = NotationFlag
HumanReadable
  toFFlag o :: Int
o = Word8 -> NotationFlag
OtherNF (Int -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
o)

instance Hashable NotationFlag

instance Pretty NotationFlag where
  pretty :: NotationFlag -> Doc ann
pretty HumanReadable = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "human-readable"
  pretty (OtherNF o :: Word8
o) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown notation flag type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
o

$(ATH.deriveJSON ATH.defaultOptions ''NotationFlag)

newtype ThirtyTwoBitTimeStamp =
  ThirtyTwoBitTimeStamp
    { ThirtyTwoBitTimeStamp -> Word32
unThirtyTwoBitTimeStamp :: Word32
    }
  deriving ( ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> Bounded ThirtyTwoBitTimeStamp
forall a. a -> a -> Bounded a
maxBound :: ThirtyTwoBitTimeStamp
$cmaxBound :: ThirtyTwoBitTimeStamp
minBound :: ThirtyTwoBitTimeStamp
$cminBound :: ThirtyTwoBitTimeStamp
Bounded
           , Typeable ThirtyTwoBitTimeStamp
Constr
DataType
Typeable ThirtyTwoBitTimeStamp =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> ThirtyTwoBitTimeStamp
 -> c ThirtyTwoBitTimeStamp)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp -> Constr)
-> (ThirtyTwoBitTimeStamp -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ThirtyTwoBitTimeStamp))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ThirtyTwoBitTimeStamp))
-> ((forall b. Data b => b -> b)
    -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (forall r r'.
    (r -> r' -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> ThirtyTwoBitTimeStamp
    -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> ThirtyTwoBitTimeStamp
    -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ThirtyTwoBitTimeStamp -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ThirtyTwoBitTimeStamp -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp)
-> Data ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp -> Constr
ThirtyTwoBitTimeStamp -> DataType
(forall b. Data b => b -> b)
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ThirtyTwoBitTimeStamp
-> c ThirtyTwoBitTimeStamp
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitTimeStamp
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) -> ThirtyTwoBitTimeStamp -> u
forall u.
(forall d. Data d => d -> u) -> ThirtyTwoBitTimeStamp -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitTimeStamp -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitTimeStamp -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitTimeStamp
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ThirtyTwoBitTimeStamp
-> c ThirtyTwoBitTimeStamp
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ThirtyTwoBitTimeStamp)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ThirtyTwoBitTimeStamp)
$cThirtyTwoBitTimeStamp :: Constr
$tThirtyTwoBitTimeStamp :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp
gmapMp :: (forall d. Data d => d -> m d)
-> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp
gmapM :: (forall d. Data d => d -> m d)
-> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitTimeStamp -> m ThirtyTwoBitTimeStamp
gmapQi :: Int -> (forall d. Data d => d -> u) -> ThirtyTwoBitTimeStamp -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ThirtyTwoBitTimeStamp -> u
gmapQ :: (forall d. Data d => d -> u) -> ThirtyTwoBitTimeStamp -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> ThirtyTwoBitTimeStamp -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitTimeStamp -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitTimeStamp -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitTimeStamp -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitTimeStamp -> r
gmapT :: (forall b. Data b => b -> b)
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cgmapT :: (forall b. Data b => b -> b)
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ThirtyTwoBitTimeStamp)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ThirtyTwoBitTimeStamp)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ThirtyTwoBitTimeStamp)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ThirtyTwoBitTimeStamp)
dataTypeOf :: ThirtyTwoBitTimeStamp -> DataType
$cdataTypeOf :: ThirtyTwoBitTimeStamp -> DataType
toConstr :: ThirtyTwoBitTimeStamp -> Constr
$ctoConstr :: ThirtyTwoBitTimeStamp -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitTimeStamp
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitTimeStamp
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ThirtyTwoBitTimeStamp
-> c ThirtyTwoBitTimeStamp
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ThirtyTwoBitTimeStamp
-> c ThirtyTwoBitTimeStamp
$cp1Data :: Typeable ThirtyTwoBitTimeStamp
Data
           , Int -> ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp -> Int
ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp]
ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp]
ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> [ThirtyTwoBitTimeStamp]
(ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (Int -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp -> Int)
-> (ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp])
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp])
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp])
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp
    -> [ThirtyTwoBitTimeStamp])
-> Enum ThirtyTwoBitTimeStamp
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> [ThirtyTwoBitTimeStamp]
$cenumFromThenTo :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> [ThirtyTwoBitTimeStamp]
enumFromTo :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp]
$cenumFromTo :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp]
enumFromThen :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp]
$cenumFromThen :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp]
enumFrom :: ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp]
$cenumFrom :: ThirtyTwoBitTimeStamp -> [ThirtyTwoBitTimeStamp]
fromEnum :: ThirtyTwoBitTimeStamp -> Int
$cfromEnum :: ThirtyTwoBitTimeStamp -> Int
toEnum :: Int -> ThirtyTwoBitTimeStamp
$ctoEnum :: Int -> ThirtyTwoBitTimeStamp
pred :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cpred :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
succ :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$csucc :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
Enum
           , ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
(ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool)
-> (ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool)
-> Eq ThirtyTwoBitTimeStamp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
$c/= :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
== :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
$c== :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
Eq
           , (forall x. ThirtyTwoBitTimeStamp -> Rep ThirtyTwoBitTimeStamp x)
-> (forall x. Rep ThirtyTwoBitTimeStamp x -> ThirtyTwoBitTimeStamp)
-> Generic ThirtyTwoBitTimeStamp
forall x. Rep ThirtyTwoBitTimeStamp x -> ThirtyTwoBitTimeStamp
forall x. ThirtyTwoBitTimeStamp -> Rep ThirtyTwoBitTimeStamp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThirtyTwoBitTimeStamp x -> ThirtyTwoBitTimeStamp
$cfrom :: forall x. ThirtyTwoBitTimeStamp -> Rep ThirtyTwoBitTimeStamp x
Generic
           , Int -> ThirtyTwoBitTimeStamp -> Int
ThirtyTwoBitTimeStamp -> Int
(Int -> ThirtyTwoBitTimeStamp -> Int)
-> (ThirtyTwoBitTimeStamp -> Int) -> Hashable ThirtyTwoBitTimeStamp
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ThirtyTwoBitTimeStamp -> Int
$chash :: ThirtyTwoBitTimeStamp -> Int
hashWithSalt :: Int -> ThirtyTwoBitTimeStamp -> Int
$chashWithSalt :: Int -> ThirtyTwoBitTimeStamp -> Int
Hashable
           , Enum ThirtyTwoBitTimeStamp
Real ThirtyTwoBitTimeStamp
(Real ThirtyTwoBitTimeStamp, Enum ThirtyTwoBitTimeStamp) =>
(ThirtyTwoBitTimeStamp
 -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp
    -> (ThirtyTwoBitTimeStamp, ThirtyTwoBitTimeStamp))
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp
    -> (ThirtyTwoBitTimeStamp, ThirtyTwoBitTimeStamp))
-> (ThirtyTwoBitTimeStamp -> Integer)
-> Integral ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp -> Integer
ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> (ThirtyTwoBitTimeStamp, ThirtyTwoBitTimeStamp)
ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
forall a.
(Real a, Enum a) =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
toInteger :: ThirtyTwoBitTimeStamp -> Integer
$ctoInteger :: ThirtyTwoBitTimeStamp -> Integer
divMod :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> (ThirtyTwoBitTimeStamp, ThirtyTwoBitTimeStamp)
$cdivMod :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> (ThirtyTwoBitTimeStamp, ThirtyTwoBitTimeStamp)
quotRem :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> (ThirtyTwoBitTimeStamp, ThirtyTwoBitTimeStamp)
$cquotRem :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp
-> (ThirtyTwoBitTimeStamp, ThirtyTwoBitTimeStamp)
mod :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cmod :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
div :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cdiv :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
rem :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$crem :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
quot :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cquot :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cp2Integral :: Enum ThirtyTwoBitTimeStamp
$cp1Integral :: Real ThirtyTwoBitTimeStamp
Integral
           , Integer -> ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
(ThirtyTwoBitTimeStamp
 -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (Integer -> ThirtyTwoBitTimeStamp)
-> Num ThirtyTwoBitTimeStamp
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> ThirtyTwoBitTimeStamp
$cfromInteger :: Integer -> ThirtyTwoBitTimeStamp
signum :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$csignum :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
abs :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cabs :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
negate :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cnegate :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
* :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$c* :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
- :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$c- :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
+ :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$c+ :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
Num
           , Eq ThirtyTwoBitTimeStamp
Eq ThirtyTwoBitTimeStamp =>
(ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Ordering)
-> (ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool)
-> (ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool)
-> (ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool)
-> (ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool)
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> (ThirtyTwoBitTimeStamp
    -> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp)
-> Ord ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Ordering
ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
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
min :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cmin :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
max :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
$cmax :: ThirtyTwoBitTimeStamp
-> ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp
>= :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
$c>= :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
> :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
$c> :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
<= :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
$c<= :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
< :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
$c< :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Bool
compare :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Ordering
$ccompare :: ThirtyTwoBitTimeStamp -> ThirtyTwoBitTimeStamp -> Ordering
$cp1Ord :: Eq ThirtyTwoBitTimeStamp
Ord
           , Num ThirtyTwoBitTimeStamp
Ord ThirtyTwoBitTimeStamp
(Num ThirtyTwoBitTimeStamp, Ord ThirtyTwoBitTimeStamp) =>
(ThirtyTwoBitTimeStamp -> Rational) -> Real ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp -> Rational
forall a. (Num a, Ord a) => (a -> Rational) -> Real a
toRational :: ThirtyTwoBitTimeStamp -> Rational
$ctoRational :: ThirtyTwoBitTimeStamp -> Rational
$cp2Real :: Ord ThirtyTwoBitTimeStamp
$cp1Real :: Num ThirtyTwoBitTimeStamp
Real
           , Int -> ThirtyTwoBitTimeStamp -> ShowS
[ThirtyTwoBitTimeStamp] -> ShowS
ThirtyTwoBitTimeStamp -> String
(Int -> ThirtyTwoBitTimeStamp -> ShowS)
-> (ThirtyTwoBitTimeStamp -> String)
-> ([ThirtyTwoBitTimeStamp] -> ShowS)
-> Show ThirtyTwoBitTimeStamp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThirtyTwoBitTimeStamp] -> ShowS
$cshowList :: [ThirtyTwoBitTimeStamp] -> ShowS
show :: ThirtyTwoBitTimeStamp -> String
$cshow :: ThirtyTwoBitTimeStamp -> String
showsPrec :: Int -> ThirtyTwoBitTimeStamp -> ShowS
$cshowsPrec :: Int -> ThirtyTwoBitTimeStamp -> ShowS
Show
           , Typeable
           )

instance Newtype ThirtyTwoBitTimeStamp Word32 where
  pack :: Word32 -> ThirtyTwoBitTimeStamp
pack = Word32 -> ThirtyTwoBitTimeStamp
ThirtyTwoBitTimeStamp
  unpack :: ThirtyTwoBitTimeStamp -> Word32
unpack (ThirtyTwoBitTimeStamp o :: Word32
o) = Word32
o

instance Pretty ThirtyTwoBitTimeStamp where
  pretty :: ThirtyTwoBitTimeStamp -> Doc ann
pretty =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (String -> Doc ann)
-> (ThirtyTwoBitTimeStamp -> String)
-> ThirtyTwoBitTimeStamp
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    TimeLocale -> String -> UTCTime -> String
forall t. FormatTime t => TimeLocale -> String -> t -> String
formatTime TimeLocale
defaultTimeLocale "%Y%m%d-%H%M%S" (UTCTime -> String)
-> (ThirtyTwoBitTimeStamp -> UTCTime)
-> ThirtyTwoBitTimeStamp
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    POSIXTime -> UTCTime
posixSecondsToUTCTime (POSIXTime -> UTCTime)
-> (ThirtyTwoBitTimeStamp -> POSIXTime)
-> ThirtyTwoBitTimeStamp
-> UTCTime
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ThirtyTwoBitTimeStamp -> POSIXTime
forall a b. (Real a, Fractional b) => a -> b
realToFrac

$(ATH.deriveJSON ATH.defaultOptions ''ThirtyTwoBitTimeStamp)

durU :: (Integral a, Show a) => a -> Maybe (String, a)
durU :: a -> Maybe (String, a)
durU x :: a
x
  | a
x a -> a -> Bool
forall a. Ord a => a -> a -> Bool
>= 31557600 = (String, a) -> Maybe (String, a)
forall a. a -> Maybe a
Just ((String -> ShowS
forall a. [a] -> [a] -> [a]
++ "y") ShowS -> (a -> String) -> a -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> String
forall a. Show a => a -> String
show (a -> String) -> a -> String
forall a b. (a -> b) -> a -> b
$ a
x a -> a -> a
forall a. Integral a => a -> a -> a
`div` 31557600, a
x a -> a -> a
forall a. Integral a => a -> a -> a
`mod` 31557600)
  | a
x a -> a -> Bool
forall a. Ord a => a -> a -> Bool
>= 2629800 = (String, a) -> Maybe (String, a)
forall a. a -> Maybe a
Just ((String -> ShowS
forall a. [a] -> [a] -> [a]
++ "m") ShowS -> (a -> String) -> a -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> String
forall a. Show a => a -> String
show (a -> String) -> a -> String
forall a b. (a -> b) -> a -> b
$ a
x a -> a -> a
forall a. Integral a => a -> a -> a
`div` 2629800, a
x a -> a -> a
forall a. Integral a => a -> a -> a
`mod` 2629800)
  | a
x a -> a -> Bool
forall a. Ord a => a -> a -> Bool
>= 86400 = (String, a) -> Maybe (String, a)
forall a. a -> Maybe a
Just ((String -> ShowS
forall a. [a] -> [a] -> [a]
++ "d") ShowS -> (a -> String) -> a -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> String
forall a. Show a => a -> String
show (a -> String) -> a -> String
forall a b. (a -> b) -> a -> b
$ a
x a -> a -> a
forall a. Integral a => a -> a -> a
`div` 86400, a
x a -> a -> a
forall a. Integral a => a -> a -> a
`mod` 86400)
  | a
x a -> a -> Bool
forall a. Ord a => a -> a -> Bool
> 0 = (String, a) -> Maybe (String, a)
forall a. a -> Maybe a
Just ((String -> ShowS
forall a. [a] -> [a] -> [a]
++ "s") ShowS -> (a -> String) -> a -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> String
forall a. Show a => a -> String
show (a -> String) -> a -> String
forall a b. (a -> b) -> a -> b
$ a
x, 0)
  | Bool
otherwise = Maybe (String, a)
forall a. Maybe a
Nothing

newtype ThirtyTwoBitDuration =
  ThirtyTwoBitDuration
    { ThirtyTwoBitDuration -> Word32
unThirtyTwoBitDuration :: Word32
    }
  deriving ( ThirtyTwoBitDuration
ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> Bounded ThirtyTwoBitDuration
forall a. a -> a -> Bounded a
maxBound :: ThirtyTwoBitDuration
$cmaxBound :: ThirtyTwoBitDuration
minBound :: ThirtyTwoBitDuration
$cminBound :: ThirtyTwoBitDuration
Bounded
           , Typeable ThirtyTwoBitDuration
Constr
DataType
Typeable ThirtyTwoBitDuration =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> ThirtyTwoBitDuration
 -> c ThirtyTwoBitDuration)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration -> Constr)
-> (ThirtyTwoBitDuration -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ThirtyTwoBitDuration))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ThirtyTwoBitDuration))
-> ((forall b. Data b => b -> b)
    -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitDuration -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitDuration -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ThirtyTwoBitDuration -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ThirtyTwoBitDuration -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration)
-> Data ThirtyTwoBitDuration
ThirtyTwoBitDuration -> Constr
ThirtyTwoBitDuration -> DataType
(forall b. Data b => b -> b)
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ThirtyTwoBitDuration
-> c ThirtyTwoBitDuration
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitDuration
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) -> ThirtyTwoBitDuration -> u
forall u.
(forall d. Data d => d -> u) -> ThirtyTwoBitDuration -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitDuration -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitDuration -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitDuration
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ThirtyTwoBitDuration
-> c ThirtyTwoBitDuration
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ThirtyTwoBitDuration)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ThirtyTwoBitDuration)
$cThirtyTwoBitDuration :: Constr
$tThirtyTwoBitDuration :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration
gmapMp :: (forall d. Data d => d -> m d)
-> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration
gmapM :: (forall d. Data d => d -> m d)
-> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ThirtyTwoBitDuration -> m ThirtyTwoBitDuration
gmapQi :: Int -> (forall d. Data d => d -> u) -> ThirtyTwoBitDuration -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ThirtyTwoBitDuration -> u
gmapQ :: (forall d. Data d => d -> u) -> ThirtyTwoBitDuration -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> ThirtyTwoBitDuration -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitDuration -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitDuration -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitDuration -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ThirtyTwoBitDuration -> r
gmapT :: (forall b. Data b => b -> b)
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cgmapT :: (forall b. Data b => b -> b)
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ThirtyTwoBitDuration)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ThirtyTwoBitDuration)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ThirtyTwoBitDuration)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ThirtyTwoBitDuration)
dataTypeOf :: ThirtyTwoBitDuration -> DataType
$cdataTypeOf :: ThirtyTwoBitDuration -> DataType
toConstr :: ThirtyTwoBitDuration -> Constr
$ctoConstr :: ThirtyTwoBitDuration -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitDuration
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ThirtyTwoBitDuration
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ThirtyTwoBitDuration
-> c ThirtyTwoBitDuration
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> ThirtyTwoBitDuration
-> c ThirtyTwoBitDuration
$cp1Data :: Typeable ThirtyTwoBitDuration
Data
           , Int -> ThirtyTwoBitDuration
ThirtyTwoBitDuration -> Int
ThirtyTwoBitDuration -> [ThirtyTwoBitDuration]
ThirtyTwoBitDuration -> ThirtyTwoBitDuration
ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> [ThirtyTwoBitDuration]
ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> [ThirtyTwoBitDuration]
(ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (Int -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration -> Int)
-> (ThirtyTwoBitDuration -> [ThirtyTwoBitDuration])
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration -> [ThirtyTwoBitDuration])
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration -> [ThirtyTwoBitDuration])
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration
    -> [ThirtyTwoBitDuration])
-> Enum ThirtyTwoBitDuration
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> [ThirtyTwoBitDuration]
$cenumFromThenTo :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> [ThirtyTwoBitDuration]
enumFromTo :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> [ThirtyTwoBitDuration]
$cenumFromTo :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> [ThirtyTwoBitDuration]
enumFromThen :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> [ThirtyTwoBitDuration]
$cenumFromThen :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> [ThirtyTwoBitDuration]
enumFrom :: ThirtyTwoBitDuration -> [ThirtyTwoBitDuration]
$cenumFrom :: ThirtyTwoBitDuration -> [ThirtyTwoBitDuration]
fromEnum :: ThirtyTwoBitDuration -> Int
$cfromEnum :: ThirtyTwoBitDuration -> Int
toEnum :: Int -> ThirtyTwoBitDuration
$ctoEnum :: Int -> ThirtyTwoBitDuration
pred :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cpred :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
succ :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$csucc :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
Enum
           , ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
(ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool)
-> (ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool)
-> Eq ThirtyTwoBitDuration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
$c/= :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
== :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
$c== :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
Eq
           , (forall x. ThirtyTwoBitDuration -> Rep ThirtyTwoBitDuration x)
-> (forall x. Rep ThirtyTwoBitDuration x -> ThirtyTwoBitDuration)
-> Generic ThirtyTwoBitDuration
forall x. Rep ThirtyTwoBitDuration x -> ThirtyTwoBitDuration
forall x. ThirtyTwoBitDuration -> Rep ThirtyTwoBitDuration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThirtyTwoBitDuration x -> ThirtyTwoBitDuration
$cfrom :: forall x. ThirtyTwoBitDuration -> Rep ThirtyTwoBitDuration x
Generic
           , Int -> ThirtyTwoBitDuration -> Int
ThirtyTwoBitDuration -> Int
(Int -> ThirtyTwoBitDuration -> Int)
-> (ThirtyTwoBitDuration -> Int) -> Hashable ThirtyTwoBitDuration
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ThirtyTwoBitDuration -> Int
$chash :: ThirtyTwoBitDuration -> Int
hashWithSalt :: Int -> ThirtyTwoBitDuration -> Int
$chashWithSalt :: Int -> ThirtyTwoBitDuration -> Int
Hashable
           , Enum ThirtyTwoBitDuration
Real ThirtyTwoBitDuration
(Real ThirtyTwoBitDuration, Enum ThirtyTwoBitDuration) =>
(ThirtyTwoBitDuration
 -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration
    -> (ThirtyTwoBitDuration, ThirtyTwoBitDuration))
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration
    -> (ThirtyTwoBitDuration, ThirtyTwoBitDuration))
-> (ThirtyTwoBitDuration -> Integer)
-> Integral ThirtyTwoBitDuration
ThirtyTwoBitDuration -> Integer
ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> (ThirtyTwoBitDuration, ThirtyTwoBitDuration)
ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
forall a.
(Real a, Enum a) =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
toInteger :: ThirtyTwoBitDuration -> Integer
$ctoInteger :: ThirtyTwoBitDuration -> Integer
divMod :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> (ThirtyTwoBitDuration, ThirtyTwoBitDuration)
$cdivMod :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> (ThirtyTwoBitDuration, ThirtyTwoBitDuration)
quotRem :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> (ThirtyTwoBitDuration, ThirtyTwoBitDuration)
$cquotRem :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration
-> (ThirtyTwoBitDuration, ThirtyTwoBitDuration)
mod :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cmod :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
div :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cdiv :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
rem :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$crem :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
quot :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cquot :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cp2Integral :: Enum ThirtyTwoBitDuration
$cp1Integral :: Real ThirtyTwoBitDuration
Integral
           , Integer -> ThirtyTwoBitDuration
ThirtyTwoBitDuration -> ThirtyTwoBitDuration
ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
(ThirtyTwoBitDuration
 -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (Integer -> ThirtyTwoBitDuration)
-> Num ThirtyTwoBitDuration
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> ThirtyTwoBitDuration
$cfromInteger :: Integer -> ThirtyTwoBitDuration
signum :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$csignum :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
abs :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cabs :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
negate :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cnegate :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration
* :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$c* :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
- :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$c- :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
+ :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$c+ :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
Num
           , Eq ThirtyTwoBitDuration
Eq ThirtyTwoBitDuration =>
(ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Ordering)
-> (ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool)
-> (ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool)
-> (ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool)
-> (ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool)
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> (ThirtyTwoBitDuration
    -> ThirtyTwoBitDuration -> ThirtyTwoBitDuration)
-> Ord ThirtyTwoBitDuration
ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Ordering
ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
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
min :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cmin :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
max :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
$cmax :: ThirtyTwoBitDuration
-> ThirtyTwoBitDuration -> ThirtyTwoBitDuration
>= :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
$c>= :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
> :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
$c> :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
<= :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
$c<= :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
< :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
$c< :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Bool
compare :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Ordering
$ccompare :: ThirtyTwoBitDuration -> ThirtyTwoBitDuration -> Ordering
$cp1Ord :: Eq ThirtyTwoBitDuration
Ord
           , Num ThirtyTwoBitDuration
Ord ThirtyTwoBitDuration
(Num ThirtyTwoBitDuration, Ord ThirtyTwoBitDuration) =>
(ThirtyTwoBitDuration -> Rational) -> Real ThirtyTwoBitDuration
ThirtyTwoBitDuration -> Rational
forall a. (Num a, Ord a) => (a -> Rational) -> Real a
toRational :: ThirtyTwoBitDuration -> Rational
$ctoRational :: ThirtyTwoBitDuration -> Rational
$cp2Real :: Ord ThirtyTwoBitDuration
$cp1Real :: Num ThirtyTwoBitDuration
Real
           , Int -> ThirtyTwoBitDuration -> ShowS
[ThirtyTwoBitDuration] -> ShowS
ThirtyTwoBitDuration -> String
(Int -> ThirtyTwoBitDuration -> ShowS)
-> (ThirtyTwoBitDuration -> String)
-> ([ThirtyTwoBitDuration] -> ShowS)
-> Show ThirtyTwoBitDuration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThirtyTwoBitDuration] -> ShowS
$cshowList :: [ThirtyTwoBitDuration] -> ShowS
show :: ThirtyTwoBitDuration -> String
$cshow :: ThirtyTwoBitDuration -> String
showsPrec :: Int -> ThirtyTwoBitDuration -> ShowS
$cshowsPrec :: Int -> ThirtyTwoBitDuration -> ShowS
Show
           , Typeable
           )

instance Newtype ThirtyTwoBitDuration Word32 where
  pack :: Word32 -> ThirtyTwoBitDuration
pack = Word32 -> ThirtyTwoBitDuration
ThirtyTwoBitDuration
  unpack :: ThirtyTwoBitDuration -> Word32
unpack (ThirtyTwoBitDuration o :: Word32
o) = Word32
o

instance Pretty ThirtyTwoBitDuration where
  pretty :: ThirtyTwoBitDuration -> Doc ann
pretty = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (String -> Doc ann)
-> (ThirtyTwoBitDuration -> String)
-> ThirtyTwoBitDuration
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([String] -> String)
-> (ThirtyTwoBitDuration -> [String])
-> ThirtyTwoBitDuration
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Maybe (String, Word32)) -> Word32 -> [String]
forall b a. (b -> Maybe (a, b)) -> b -> [a]
unfoldr Word32 -> Maybe (String, Word32)
forall a. (Integral a, Show a) => a -> Maybe (String, a)
durU (Word32 -> [String])
-> (ThirtyTwoBitDuration -> Word32)
-> ThirtyTwoBitDuration
-> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ThirtyTwoBitDuration -> Word32
forall n o. Newtype n o => n -> o
unpack

$(ATH.deriveJSON ATH.defaultOptions ''ThirtyTwoBitDuration)

data RevocationClass
  = SensitiveRK
  | RClOther Word8 -- FIXME: this should be constrained to 3 bits
  deriving (Typeable RevocationClass
Constr
DataType
Typeable RevocationClass =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> RevocationClass -> c RevocationClass)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RevocationClass)
-> (RevocationClass -> Constr)
-> (RevocationClass -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RevocationClass))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RevocationClass))
-> ((forall b. Data b => b -> b)
    -> RevocationClass -> RevocationClass)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RevocationClass -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RevocationClass -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> RevocationClass -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> RevocationClass -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> RevocationClass -> m RevocationClass)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RevocationClass -> m RevocationClass)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RevocationClass -> m RevocationClass)
-> Data RevocationClass
RevocationClass -> Constr
RevocationClass -> DataType
(forall b. Data b => b -> b) -> RevocationClass -> RevocationClass
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RevocationClass -> c RevocationClass
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RevocationClass
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) -> RevocationClass -> u
forall u. (forall d. Data d => d -> u) -> RevocationClass -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationClass -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationClass -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> RevocationClass -> m RevocationClass
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RevocationClass -> m RevocationClass
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RevocationClass
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RevocationClass -> c RevocationClass
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RevocationClass)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RevocationClass)
$cRClOther :: Constr
$cSensitiveRK :: Constr
$tRevocationClass :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> RevocationClass -> m RevocationClass
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RevocationClass -> m RevocationClass
gmapMp :: (forall d. Data d => d -> m d)
-> RevocationClass -> m RevocationClass
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RevocationClass -> m RevocationClass
gmapM :: (forall d. Data d => d -> m d)
-> RevocationClass -> m RevocationClass
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> RevocationClass -> m RevocationClass
gmapQi :: Int -> (forall d. Data d => d -> u) -> RevocationClass -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> RevocationClass -> u
gmapQ :: (forall d. Data d => d -> u) -> RevocationClass -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> RevocationClass -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationClass -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationClass -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationClass -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationClass -> r
gmapT :: (forall b. Data b => b -> b) -> RevocationClass -> RevocationClass
$cgmapT :: (forall b. Data b => b -> b) -> RevocationClass -> RevocationClass
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RevocationClass)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RevocationClass)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c RevocationClass)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RevocationClass)
dataTypeOf :: RevocationClass -> DataType
$cdataTypeOf :: RevocationClass -> DataType
toConstr :: RevocationClass -> Constr
$ctoConstr :: RevocationClass -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RevocationClass
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RevocationClass
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RevocationClass -> c RevocationClass
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RevocationClass -> c RevocationClass
$cp1Data :: Typeable RevocationClass
Data, (forall x. RevocationClass -> Rep RevocationClass x)
-> (forall x. Rep RevocationClass x -> RevocationClass)
-> Generic RevocationClass
forall x. Rep RevocationClass x -> RevocationClass
forall x. RevocationClass -> Rep RevocationClass x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RevocationClass x -> RevocationClass
$cfrom :: forall x. RevocationClass -> Rep RevocationClass x
Generic, Int -> RevocationClass -> ShowS
[RevocationClass] -> ShowS
RevocationClass -> String
(Int -> RevocationClass -> ShowS)
-> (RevocationClass -> String)
-> ([RevocationClass] -> ShowS)
-> Show RevocationClass
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevocationClass] -> ShowS
$cshowList :: [RevocationClass] -> ShowS
show :: RevocationClass -> String
$cshow :: RevocationClass -> String
showsPrec :: Int -> RevocationClass -> ShowS
$cshowsPrec :: Int -> RevocationClass -> ShowS
Show, Typeable)

instance Eq RevocationClass where
  == :: RevocationClass -> RevocationClass -> Bool
(==) a :: RevocationClass
a b :: RevocationClass
b = RevocationClass -> Int
forall a. FutureFlag a => a -> Int
fromFFlag RevocationClass
a Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== RevocationClass -> Int
forall a. FutureFlag a => a -> Int
fromFFlag RevocationClass
b

instance Ord RevocationClass where
  compare :: RevocationClass -> RevocationClass -> Ordering
compare = (RevocationClass -> Int)
-> RevocationClass -> RevocationClass -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing RevocationClass -> Int
forall a. FutureFlag a => a -> Int
fromFFlag

instance FutureFlag RevocationClass where
  fromFFlag :: RevocationClass -> Int
fromFFlag SensitiveRK = 1
  fromFFlag (RClOther i :: Word8
i) = Word8 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
i
  toFFlag :: Int -> RevocationClass
toFFlag 1 = RevocationClass
SensitiveRK
  toFFlag i :: Int
i = Word8 -> RevocationClass
RClOther (Int -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i)

instance Hashable RevocationClass

instance Pretty RevocationClass where
  pretty :: RevocationClass -> Doc ann
pretty SensitiveRK = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "sensitive"
  pretty (RClOther o :: Word8
o) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown revocation class" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
o

$(ATH.deriveJSON ATH.defaultOptions ''RevocationClass)

data PubKeyAlgorithm
  = RSA
  | DeprecatedRSAEncryptOnly
  | DeprecatedRSASignOnly
  | ElgamalEncryptOnly
  | DSA
  | ECDH
  | ECDSA
  | ForbiddenElgamal
  | DH
  | EdDSA
  | OtherPKA Word8
  deriving (Int -> PubKeyAlgorithm -> ShowS
[PubKeyAlgorithm] -> ShowS
PubKeyAlgorithm -> String
(Int -> PubKeyAlgorithm -> ShowS)
-> (PubKeyAlgorithm -> String)
-> ([PubKeyAlgorithm] -> ShowS)
-> Show PubKeyAlgorithm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PubKeyAlgorithm] -> ShowS
$cshowList :: [PubKeyAlgorithm] -> ShowS
show :: PubKeyAlgorithm -> String
$cshow :: PubKeyAlgorithm -> String
showsPrec :: Int -> PubKeyAlgorithm -> ShowS
$cshowsPrec :: Int -> PubKeyAlgorithm -> ShowS
Show, Typeable PubKeyAlgorithm
Constr
DataType
Typeable PubKeyAlgorithm =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> PubKeyAlgorithm -> c PubKeyAlgorithm)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c PubKeyAlgorithm)
-> (PubKeyAlgorithm -> Constr)
-> (PubKeyAlgorithm -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c PubKeyAlgorithm))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c PubKeyAlgorithm))
-> ((forall b. Data b => b -> b)
    -> PubKeyAlgorithm -> PubKeyAlgorithm)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> PubKeyAlgorithm -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> PubKeyAlgorithm -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> PubKeyAlgorithm -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> PubKeyAlgorithm -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> PubKeyAlgorithm -> m PubKeyAlgorithm)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> PubKeyAlgorithm -> m PubKeyAlgorithm)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> PubKeyAlgorithm -> m PubKeyAlgorithm)
-> Data PubKeyAlgorithm
PubKeyAlgorithm -> Constr
PubKeyAlgorithm -> DataType
(forall b. Data b => b -> b) -> PubKeyAlgorithm -> PubKeyAlgorithm
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PubKeyAlgorithm -> c PubKeyAlgorithm
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PubKeyAlgorithm
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) -> PubKeyAlgorithm -> u
forall u. (forall d. Data d => d -> u) -> PubKeyAlgorithm -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PubKeyAlgorithm -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PubKeyAlgorithm -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PubKeyAlgorithm -> m PubKeyAlgorithm
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PubKeyAlgorithm -> m PubKeyAlgorithm
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PubKeyAlgorithm
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PubKeyAlgorithm -> c PubKeyAlgorithm
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PubKeyAlgorithm)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PubKeyAlgorithm)
$cOtherPKA :: Constr
$cEdDSA :: Constr
$cDH :: Constr
$cForbiddenElgamal :: Constr
$cECDSA :: Constr
$cECDH :: Constr
$cDSA :: Constr
$cElgamalEncryptOnly :: Constr
$cDeprecatedRSASignOnly :: Constr
$cDeprecatedRSAEncryptOnly :: Constr
$cRSA :: Constr
$tPubKeyAlgorithm :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> PubKeyAlgorithm -> m PubKeyAlgorithm
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PubKeyAlgorithm -> m PubKeyAlgorithm
gmapMp :: (forall d. Data d => d -> m d)
-> PubKeyAlgorithm -> m PubKeyAlgorithm
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> PubKeyAlgorithm -> m PubKeyAlgorithm
gmapM :: (forall d. Data d => d -> m d)
-> PubKeyAlgorithm -> m PubKeyAlgorithm
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> PubKeyAlgorithm -> m PubKeyAlgorithm
gmapQi :: Int -> (forall d. Data d => d -> u) -> PubKeyAlgorithm -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> PubKeyAlgorithm -> u
gmapQ :: (forall d. Data d => d -> u) -> PubKeyAlgorithm -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> PubKeyAlgorithm -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PubKeyAlgorithm -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> PubKeyAlgorithm -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PubKeyAlgorithm -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> PubKeyAlgorithm -> r
gmapT :: (forall b. Data b => b -> b) -> PubKeyAlgorithm -> PubKeyAlgorithm
$cgmapT :: (forall b. Data b => b -> b) -> PubKeyAlgorithm -> PubKeyAlgorithm
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PubKeyAlgorithm)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c PubKeyAlgorithm)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c PubKeyAlgorithm)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c PubKeyAlgorithm)
dataTypeOf :: PubKeyAlgorithm -> DataType
$cdataTypeOf :: PubKeyAlgorithm -> DataType
toConstr :: PubKeyAlgorithm -> Constr
$ctoConstr :: PubKeyAlgorithm -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PubKeyAlgorithm
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c PubKeyAlgorithm
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PubKeyAlgorithm -> c PubKeyAlgorithm
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> PubKeyAlgorithm -> c PubKeyAlgorithm
$cp1Data :: Typeable PubKeyAlgorithm
Data, (forall x. PubKeyAlgorithm -> Rep PubKeyAlgorithm x)
-> (forall x. Rep PubKeyAlgorithm x -> PubKeyAlgorithm)
-> Generic PubKeyAlgorithm
forall x. Rep PubKeyAlgorithm x -> PubKeyAlgorithm
forall x. PubKeyAlgorithm -> Rep PubKeyAlgorithm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PubKeyAlgorithm x -> PubKeyAlgorithm
$cfrom :: forall x. PubKeyAlgorithm -> Rep PubKeyAlgorithm x
Generic, Typeable)

instance Eq PubKeyAlgorithm where
  == :: PubKeyAlgorithm -> PubKeyAlgorithm -> Bool
(==) a :: PubKeyAlgorithm
a b :: PubKeyAlgorithm
b = PubKeyAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal PubKeyAlgorithm
a Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
== PubKeyAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal PubKeyAlgorithm
b

instance Ord PubKeyAlgorithm where
  compare :: PubKeyAlgorithm -> PubKeyAlgorithm -> Ordering
compare = (PubKeyAlgorithm -> Word8)
-> PubKeyAlgorithm -> PubKeyAlgorithm -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing PubKeyAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal

instance FutureVal PubKeyAlgorithm where
  fromFVal :: PubKeyAlgorithm -> Word8
fromFVal RSA = 1
  fromFVal DeprecatedRSAEncryptOnly = 2
  fromFVal DeprecatedRSASignOnly = 3
  fromFVal ElgamalEncryptOnly = 16
  fromFVal DSA = 17
  fromFVal ECDH = 18
  fromFVal ECDSA = 19
  fromFVal ForbiddenElgamal = 20
  fromFVal DH = 21
  fromFVal EdDSA = 22
  fromFVal (OtherPKA o :: Word8
o) = Word8
o
  toFVal :: Word8 -> PubKeyAlgorithm
toFVal 1 = PubKeyAlgorithm
RSA
  toFVal 2 = PubKeyAlgorithm
DeprecatedRSAEncryptOnly
  toFVal 3 = PubKeyAlgorithm
DeprecatedRSASignOnly
  toFVal 16 = PubKeyAlgorithm
ElgamalEncryptOnly
  toFVal 17 = PubKeyAlgorithm
DSA
  toFVal 18 = PubKeyAlgorithm
ECDH
  toFVal 19 = PubKeyAlgorithm
ECDSA
  toFVal 20 = PubKeyAlgorithm
ForbiddenElgamal
  toFVal 21 = PubKeyAlgorithm
DH
  toFVal 22 = PubKeyAlgorithm
EdDSA
  toFVal o :: Word8
o = Word8 -> PubKeyAlgorithm
OtherPKA Word8
o

instance Hashable PubKeyAlgorithm

instance Pretty PubKeyAlgorithm where
  pretty :: PubKeyAlgorithm -> Doc ann
pretty RSA = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "RSA"
  pretty DeprecatedRSAEncryptOnly = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "(deprecated) RSA encrypt-only"
  pretty DeprecatedRSASignOnly = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "(deprecated) RSA sign-only"
  pretty ElgamalEncryptOnly = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "Elgamal encrypt-only"
  pretty DSA = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "DSA"
  pretty ECDH = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "ECDH"
  pretty ECDSA = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "ECDSA"
  pretty ForbiddenElgamal = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "(forbidden) Elgamal"
  pretty DH = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "DH"
  pretty EdDSA = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "EdDSA"
  pretty (OtherPKA pka :: Word8
pka) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown pubkey algorithm type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
pka

$(ATH.deriveJSON ATH.defaultOptions ''PubKeyAlgorithm)

newtype TwentyOctetFingerprint =
  TwentyOctetFingerprint
    { TwentyOctetFingerprint -> ByteString
unTOF :: ByteString
    }
  deriving (Typeable TwentyOctetFingerprint
Constr
DataType
Typeable TwentyOctetFingerprint =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> TwentyOctetFingerprint
 -> c TwentyOctetFingerprint)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c TwentyOctetFingerprint)
-> (TwentyOctetFingerprint -> Constr)
-> (TwentyOctetFingerprint -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c TwentyOctetFingerprint))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c TwentyOctetFingerprint))
-> ((forall b. Data b => b -> b)
    -> TwentyOctetFingerprint -> TwentyOctetFingerprint)
-> (forall r r'.
    (r -> r' -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> TwentyOctetFingerprint
    -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> TwentyOctetFingerprint
    -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> TwentyOctetFingerprint -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> TwentyOctetFingerprint -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> TwentyOctetFingerprint -> m TwentyOctetFingerprint)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TwentyOctetFingerprint -> m TwentyOctetFingerprint)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> TwentyOctetFingerprint -> m TwentyOctetFingerprint)
-> Data TwentyOctetFingerprint
TwentyOctetFingerprint -> Constr
TwentyOctetFingerprint -> DataType
(forall b. Data b => b -> b)
-> TwentyOctetFingerprint -> TwentyOctetFingerprint
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TwentyOctetFingerprint
-> c TwentyOctetFingerprint
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TwentyOctetFingerprint
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) -> TwentyOctetFingerprint -> u
forall u.
(forall d. Data d => d -> u) -> TwentyOctetFingerprint -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> TwentyOctetFingerprint
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> TwentyOctetFingerprint
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TwentyOctetFingerprint -> m TwentyOctetFingerprint
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TwentyOctetFingerprint -> m TwentyOctetFingerprint
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TwentyOctetFingerprint
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TwentyOctetFingerprint
-> c TwentyOctetFingerprint
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TwentyOctetFingerprint)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TwentyOctetFingerprint)
$cTwentyOctetFingerprint :: Constr
$tTwentyOctetFingerprint :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> TwentyOctetFingerprint -> m TwentyOctetFingerprint
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TwentyOctetFingerprint -> m TwentyOctetFingerprint
gmapMp :: (forall d. Data d => d -> m d)
-> TwentyOctetFingerprint -> m TwentyOctetFingerprint
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> TwentyOctetFingerprint -> m TwentyOctetFingerprint
gmapM :: (forall d. Data d => d -> m d)
-> TwentyOctetFingerprint -> m TwentyOctetFingerprint
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> TwentyOctetFingerprint -> m TwentyOctetFingerprint
gmapQi :: Int -> (forall d. Data d => d -> u) -> TwentyOctetFingerprint -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> TwentyOctetFingerprint -> u
gmapQ :: (forall d. Data d => d -> u) -> TwentyOctetFingerprint -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> TwentyOctetFingerprint -> [u]
gmapQr :: (r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> TwentyOctetFingerprint
-> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> TwentyOctetFingerprint
-> r
gmapQl :: (r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> TwentyOctetFingerprint
-> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> TwentyOctetFingerprint
-> r
gmapT :: (forall b. Data b => b -> b)
-> TwentyOctetFingerprint -> TwentyOctetFingerprint
$cgmapT :: (forall b. Data b => b -> b)
-> TwentyOctetFingerprint -> TwentyOctetFingerprint
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TwentyOctetFingerprint)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c TwentyOctetFingerprint)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c TwentyOctetFingerprint)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c TwentyOctetFingerprint)
dataTypeOf :: TwentyOctetFingerprint -> DataType
$cdataTypeOf :: TwentyOctetFingerprint -> DataType
toConstr :: TwentyOctetFingerprint -> Constr
$ctoConstr :: TwentyOctetFingerprint -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TwentyOctetFingerprint
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c TwentyOctetFingerprint
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TwentyOctetFingerprint
-> c TwentyOctetFingerprint
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> TwentyOctetFingerprint
-> c TwentyOctetFingerprint
$cp1Data :: Typeable TwentyOctetFingerprint
Data, TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
(TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool)
-> (TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool)
-> Eq TwentyOctetFingerprint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
$c/= :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
== :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
$c== :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
Eq, (forall x. TwentyOctetFingerprint -> Rep TwentyOctetFingerprint x)
-> (forall x.
    Rep TwentyOctetFingerprint x -> TwentyOctetFingerprint)
-> Generic TwentyOctetFingerprint
forall x. Rep TwentyOctetFingerprint x -> TwentyOctetFingerprint
forall x. TwentyOctetFingerprint -> Rep TwentyOctetFingerprint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TwentyOctetFingerprint x -> TwentyOctetFingerprint
$cfrom :: forall x. TwentyOctetFingerprint -> Rep TwentyOctetFingerprint x
Generic, Eq TwentyOctetFingerprint
Eq TwentyOctetFingerprint =>
(TwentyOctetFingerprint -> TwentyOctetFingerprint -> Ordering)
-> (TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool)
-> (TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool)
-> (TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool)
-> (TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool)
-> (TwentyOctetFingerprint
    -> TwentyOctetFingerprint -> TwentyOctetFingerprint)
-> (TwentyOctetFingerprint
    -> TwentyOctetFingerprint -> TwentyOctetFingerprint)
-> Ord TwentyOctetFingerprint
TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
TwentyOctetFingerprint -> TwentyOctetFingerprint -> Ordering
TwentyOctetFingerprint
-> TwentyOctetFingerprint -> TwentyOctetFingerprint
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
min :: TwentyOctetFingerprint
-> TwentyOctetFingerprint -> TwentyOctetFingerprint
$cmin :: TwentyOctetFingerprint
-> TwentyOctetFingerprint -> TwentyOctetFingerprint
max :: TwentyOctetFingerprint
-> TwentyOctetFingerprint -> TwentyOctetFingerprint
$cmax :: TwentyOctetFingerprint
-> TwentyOctetFingerprint -> TwentyOctetFingerprint
>= :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
$c>= :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
> :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
$c> :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
<= :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
$c<= :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
< :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
$c< :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Bool
compare :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Ordering
$ccompare :: TwentyOctetFingerprint -> TwentyOctetFingerprint -> Ordering
$cp1Ord :: Eq TwentyOctetFingerprint
Ord, Int -> TwentyOctetFingerprint -> ShowS
[TwentyOctetFingerprint] -> ShowS
TwentyOctetFingerprint -> String
(Int -> TwentyOctetFingerprint -> ShowS)
-> (TwentyOctetFingerprint -> String)
-> ([TwentyOctetFingerprint] -> ShowS)
-> Show TwentyOctetFingerprint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TwentyOctetFingerprint] -> ShowS
$cshowList :: [TwentyOctetFingerprint] -> ShowS
show :: TwentyOctetFingerprint -> String
$cshow :: TwentyOctetFingerprint -> String
showsPrec :: Int -> TwentyOctetFingerprint -> ShowS
$cshowsPrec :: Int -> TwentyOctetFingerprint -> ShowS
Show, Typeable)

instance Newtype TwentyOctetFingerprint ByteString where
  pack :: ByteString -> TwentyOctetFingerprint
pack = ByteString -> TwentyOctetFingerprint
TwentyOctetFingerprint
  unpack :: TwentyOctetFingerprint -> ByteString
unpack (TwentyOctetFingerprint o :: ByteString
o) = ByteString
o

-- FIXME: read-show
instance Read TwentyOctetFingerprint where
  readsPrec :: Int -> ReadS TwentyOctetFingerprint
readsPrec _ =
    ([(Word8, String)] -> (TwentyOctetFingerprint, String))
-> [[(Word8, String)]] -> [(TwentyOctetFingerprint, String)]
forall a b. (a -> b) -> [a] -> [b]
map ((ByteString -> TwentyOctetFingerprint
TwentyOctetFingerprint (ByteString -> TwentyOctetFingerprint)
-> ([Word8] -> ByteString) -> [Word8] -> TwentyOctetFingerprint
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Word8] -> ByteString
BL.pack ([Word8] -> TwentyOctetFingerprint)
-> ([String] -> String)
-> ([Word8], [String])
-> (TwentyOctetFingerprint, String)
forall (a :: * -> * -> *) b c b' c'.
Arrow a =>
a b c -> a b' c' -> a (b, b') (c, c')
*** [String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat) (([Word8], [String]) -> (TwentyOctetFingerprint, String))
-> ([(Word8, String)] -> ([Word8], [String]))
-> [(Word8, String)]
-> (TwentyOctetFingerprint, String)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Word8, String)] -> ([Word8], [String])
forall a b. [(a, b)] -> ([a], [b])
unzip) ([[(Word8, String)]] -> [(TwentyOctetFingerprint, String)])
-> (String -> [[(Word8, String)]]) -> ReadS TwentyOctetFingerprint
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    Int -> [(Word8, String)] -> [[(Word8, String)]]
forall e. Int -> [e] -> [[e]]
chunksOf 20 ([(Word8, String)] -> [[(Word8, String)]])
-> (String -> [(Word8, String)]) -> String -> [[(Word8, String)]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [(Word8, String)]
hexToW8s (String -> [(Word8, String)])
-> ShowS -> String -> [(Word8, String)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Bool) -> ShowS
forall a. (a -> Bool) -> [a] -> [a]
filter (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
/= ' ')

instance Hashable TwentyOctetFingerprint

instance Pretty TwentyOctetFingerprint where
  pretty :: TwentyOctetFingerprint -> Doc ann
pretty = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (String -> Doc ann)
-> (TwentyOctetFingerprint -> String)
-> TwentyOctetFingerprint
-> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ShowS
forall a. Int -> [a] -> [a]
take 40 ShowS
-> (TwentyOctetFingerprint -> String)
-> TwentyOctetFingerprint
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> String
bsToHexUpper (ByteString -> String)
-> (TwentyOctetFingerprint -> ByteString)
-> TwentyOctetFingerprint
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TwentyOctetFingerprint -> ByteString
unTOF

instance A.ToJSON TwentyOctetFingerprint where
  toJSON :: TwentyOctetFingerprint -> Value
toJSON e :: TwentyOctetFingerprint
e = [Pair] -> Value
object [String -> Text
T.pack "fpr" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (String -> Value
forall a. ToJSON a => a -> Value
A.toJSON (String -> Value)
-> (TwentyOctetFingerprint -> String)
-> TwentyOctetFingerprint
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Doc Any -> String
forall a. Show a => a -> String
show (Doc Any -> String)
-> (TwentyOctetFingerprint -> Doc Any)
-> TwentyOctetFingerprint
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TwentyOctetFingerprint -> Doc Any
forall a ann. Pretty a => a -> Doc ann
pretty) TwentyOctetFingerprint
e]

instance A.FromJSON TwentyOctetFingerprint where
  parseJSON :: Value -> Parser TwentyOctetFingerprint
parseJSON (A.Object v :: Object
v) = ByteString -> TwentyOctetFingerprint
TwentyOctetFingerprint (ByteString -> TwentyOctetFingerprint)
-> (String -> ByteString) -> String -> TwentyOctetFingerprint
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ByteString
forall a. Read a => String -> a
read (String -> TwentyOctetFingerprint)
-> Parser String -> Parser TwentyOctetFingerprint
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser String
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "fpr"
  parseJSON _ = Parser TwentyOctetFingerprint
forall (m :: * -> *) a. MonadPlus m => m a
mzero

newtype SpacedFingerprint =
  SpacedFingerprint
    { SpacedFingerprint -> TwentyOctetFingerprint
unSpacedFingerprint :: TwentyOctetFingerprint
    }

instance Newtype SpacedFingerprint TwentyOctetFingerprint where
  pack :: TwentyOctetFingerprint -> SpacedFingerprint
pack = TwentyOctetFingerprint -> SpacedFingerprint
SpacedFingerprint
  unpack :: SpacedFingerprint -> TwentyOctetFingerprint
unpack (SpacedFingerprint o :: TwentyOctetFingerprint
o) = TwentyOctetFingerprint
o

instance Pretty SpacedFingerprint where
  pretty :: SpacedFingerprint -> Doc ann
pretty =
    [Doc ann] -> Doc ann
forall ann. [Doc ann] -> Doc ann
hsep ([Doc ann] -> Doc ann)
-> (SpacedFingerprint -> [Doc ann]) -> SpacedFingerprint -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    Doc ann -> [Doc ann] -> [Doc ann]
forall ann. Doc ann -> [Doc ann] -> [Doc ann]
punctuate Doc ann
forall ann. Doc ann
space ([Doc ann] -> [Doc ann])
-> (SpacedFingerprint -> [Doc ann])
-> SpacedFingerprint
-> [Doc ann]
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    ([Doc ann] -> Doc ann) -> [[Doc ann]] -> [Doc ann]
forall a b. (a -> b) -> [a] -> [b]
map [Doc ann] -> Doc ann
forall ann. [Doc ann] -> Doc ann
hsep ([[Doc ann]] -> [Doc ann])
-> (SpacedFingerprint -> [[Doc ann]])
-> SpacedFingerprint
-> [Doc ann]
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    Int -> [Doc ann] -> [[Doc ann]]
forall e. Int -> [e] -> [[e]]
chunksOf 5 ([Doc ann] -> [[Doc ann]])
-> (SpacedFingerprint -> [Doc ann])
-> SpacedFingerprint
-> [[Doc ann]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (String -> Doc ann) -> [String] -> [Doc ann]
forall a b. (a -> b) -> [a] -> [b]
map String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ([String] -> [Doc ann])
-> (SpacedFingerprint -> [String])
-> SpacedFingerprint
-> [Doc ann]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> String -> [String]
forall e. Int -> [e] -> [[e]]
chunksOf 4 (String -> [String])
-> (SpacedFingerprint -> String) -> SpacedFingerprint -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> ShowS
forall a. Int -> [a] -> [a]
take 40 ShowS
-> (SpacedFingerprint -> String) -> SpacedFingerprint -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> String
bsToHexUpper (ByteString -> String)
-> (SpacedFingerprint -> ByteString) -> SpacedFingerprint -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TwentyOctetFingerprint -> ByteString
unTOF (TwentyOctetFingerprint -> ByteString)
-> (SpacedFingerprint -> TwentyOctetFingerprint)
-> SpacedFingerprint
-> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SpacedFingerprint -> TwentyOctetFingerprint
forall n o. Newtype n o => n -> o
unpack

bsToHexUpper :: ByteString -> String
bsToHexUpper :: ByteString -> String
bsToHexUpper = (Char -> Char) -> ShowS
forall a b. (a -> b) -> [a] -> [b]
map Char -> Char
toUpper ShowS -> (ByteString -> String) -> ByteString -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> String
BLC8.unpack (ByteString -> String)
-> (ByteString -> ByteString) -> ByteString -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> ByteString
B16L.encode

hexToW8s :: ReadS Word8
hexToW8s :: String -> [(Word8, String)]
hexToW8s = (String -> [(Word8, String)]) -> [String] -> [(Word8, String)]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap String -> [(Word8, String)]
forall a. (Eq a, Num a) => ReadS a
readHex ([String] -> [(Word8, String)])
-> (String -> [String]) -> String -> [(Word8, String)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> String -> [String]
forall e. Int -> [e] -> [[e]]
chunksOf 2 (String -> [String]) -> ShowS -> String -> [String]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Char -> Char) -> ShowS
forall a b. (a -> b) -> [a] -> [b]
map Char -> Char
toLower

newtype EightOctetKeyId =
  EightOctetKeyId
    { EightOctetKeyId -> ByteString
unEOKI :: ByteString
    }
  deriving (Typeable EightOctetKeyId
Constr
DataType
Typeable EightOctetKeyId =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> EightOctetKeyId -> c EightOctetKeyId)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c EightOctetKeyId)
-> (EightOctetKeyId -> Constr)
-> (EightOctetKeyId -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c EightOctetKeyId))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c EightOctetKeyId))
-> ((forall b. Data b => b -> b)
    -> EightOctetKeyId -> EightOctetKeyId)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> EightOctetKeyId -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> EightOctetKeyId -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> EightOctetKeyId -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> EightOctetKeyId -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> EightOctetKeyId -> m EightOctetKeyId)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> EightOctetKeyId -> m EightOctetKeyId)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> EightOctetKeyId -> m EightOctetKeyId)
-> Data EightOctetKeyId
EightOctetKeyId -> Constr
EightOctetKeyId -> DataType
(forall b. Data b => b -> b) -> EightOctetKeyId -> EightOctetKeyId
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> EightOctetKeyId -> c EightOctetKeyId
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c EightOctetKeyId
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) -> EightOctetKeyId -> u
forall u. (forall d. Data d => d -> u) -> EightOctetKeyId -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> EightOctetKeyId -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> EightOctetKeyId -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> EightOctetKeyId -> m EightOctetKeyId
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> EightOctetKeyId -> m EightOctetKeyId
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c EightOctetKeyId
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> EightOctetKeyId -> c EightOctetKeyId
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c EightOctetKeyId)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c EightOctetKeyId)
$cEightOctetKeyId :: Constr
$tEightOctetKeyId :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> EightOctetKeyId -> m EightOctetKeyId
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> EightOctetKeyId -> m EightOctetKeyId
gmapMp :: (forall d. Data d => d -> m d)
-> EightOctetKeyId -> m EightOctetKeyId
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> EightOctetKeyId -> m EightOctetKeyId
gmapM :: (forall d. Data d => d -> m d)
-> EightOctetKeyId -> m EightOctetKeyId
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> EightOctetKeyId -> m EightOctetKeyId
gmapQi :: Int -> (forall d. Data d => d -> u) -> EightOctetKeyId -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> EightOctetKeyId -> u
gmapQ :: (forall d. Data d => d -> u) -> EightOctetKeyId -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> EightOctetKeyId -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> EightOctetKeyId -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> EightOctetKeyId -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> EightOctetKeyId -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> EightOctetKeyId -> r
gmapT :: (forall b. Data b => b -> b) -> EightOctetKeyId -> EightOctetKeyId
$cgmapT :: (forall b. Data b => b -> b) -> EightOctetKeyId -> EightOctetKeyId
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c EightOctetKeyId)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c EightOctetKeyId)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c EightOctetKeyId)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c EightOctetKeyId)
dataTypeOf :: EightOctetKeyId -> DataType
$cdataTypeOf :: EightOctetKeyId -> DataType
toConstr :: EightOctetKeyId -> Constr
$ctoConstr :: EightOctetKeyId -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c EightOctetKeyId
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c EightOctetKeyId
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> EightOctetKeyId -> c EightOctetKeyId
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> EightOctetKeyId -> c EightOctetKeyId
$cp1Data :: Typeable EightOctetKeyId
Data, EightOctetKeyId -> EightOctetKeyId -> Bool
(EightOctetKeyId -> EightOctetKeyId -> Bool)
-> (EightOctetKeyId -> EightOctetKeyId -> Bool)
-> Eq EightOctetKeyId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EightOctetKeyId -> EightOctetKeyId -> Bool
$c/= :: EightOctetKeyId -> EightOctetKeyId -> Bool
== :: EightOctetKeyId -> EightOctetKeyId -> Bool
$c== :: EightOctetKeyId -> EightOctetKeyId -> Bool
Eq, (forall x. EightOctetKeyId -> Rep EightOctetKeyId x)
-> (forall x. Rep EightOctetKeyId x -> EightOctetKeyId)
-> Generic EightOctetKeyId
forall x. Rep EightOctetKeyId x -> EightOctetKeyId
forall x. EightOctetKeyId -> Rep EightOctetKeyId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EightOctetKeyId x -> EightOctetKeyId
$cfrom :: forall x. EightOctetKeyId -> Rep EightOctetKeyId x
Generic, Eq EightOctetKeyId
Eq EightOctetKeyId =>
(EightOctetKeyId -> EightOctetKeyId -> Ordering)
-> (EightOctetKeyId -> EightOctetKeyId -> Bool)
-> (EightOctetKeyId -> EightOctetKeyId -> Bool)
-> (EightOctetKeyId -> EightOctetKeyId -> Bool)
-> (EightOctetKeyId -> EightOctetKeyId -> Bool)
-> (EightOctetKeyId -> EightOctetKeyId -> EightOctetKeyId)
-> (EightOctetKeyId -> EightOctetKeyId -> EightOctetKeyId)
-> Ord EightOctetKeyId
EightOctetKeyId -> EightOctetKeyId -> Bool
EightOctetKeyId -> EightOctetKeyId -> Ordering
EightOctetKeyId -> EightOctetKeyId -> EightOctetKeyId
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
min :: EightOctetKeyId -> EightOctetKeyId -> EightOctetKeyId
$cmin :: EightOctetKeyId -> EightOctetKeyId -> EightOctetKeyId
max :: EightOctetKeyId -> EightOctetKeyId -> EightOctetKeyId
$cmax :: EightOctetKeyId -> EightOctetKeyId -> EightOctetKeyId
>= :: EightOctetKeyId -> EightOctetKeyId -> Bool
$c>= :: EightOctetKeyId -> EightOctetKeyId -> Bool
> :: EightOctetKeyId -> EightOctetKeyId -> Bool
$c> :: EightOctetKeyId -> EightOctetKeyId -> Bool
<= :: EightOctetKeyId -> EightOctetKeyId -> Bool
$c<= :: EightOctetKeyId -> EightOctetKeyId -> Bool
< :: EightOctetKeyId -> EightOctetKeyId -> Bool
$c< :: EightOctetKeyId -> EightOctetKeyId -> Bool
compare :: EightOctetKeyId -> EightOctetKeyId -> Ordering
$ccompare :: EightOctetKeyId -> EightOctetKeyId -> Ordering
$cp1Ord :: Eq EightOctetKeyId
Ord, Int -> EightOctetKeyId -> ShowS
[EightOctetKeyId] -> ShowS
EightOctetKeyId -> String
(Int -> EightOctetKeyId -> ShowS)
-> (EightOctetKeyId -> String)
-> ([EightOctetKeyId] -> ShowS)
-> Show EightOctetKeyId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EightOctetKeyId] -> ShowS
$cshowList :: [EightOctetKeyId] -> ShowS
show :: EightOctetKeyId -> String
$cshow :: EightOctetKeyId -> String
showsPrec :: Int -> EightOctetKeyId -> ShowS
$cshowsPrec :: Int -> EightOctetKeyId -> ShowS
Show, Typeable)

instance Newtype EightOctetKeyId ByteString where
  pack :: ByteString -> EightOctetKeyId
pack = ByteString -> EightOctetKeyId
EightOctetKeyId
  unpack :: EightOctetKeyId -> ByteString
unpack (EightOctetKeyId o :: ByteString
o) = ByteString
o

instance Pretty EightOctetKeyId where
  pretty :: EightOctetKeyId -> Doc ann
pretty = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (String -> Doc ann)
-> (EightOctetKeyId -> String) -> EightOctetKeyId -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> String
bsToHexUpper (ByteString -> String)
-> (EightOctetKeyId -> ByteString) -> EightOctetKeyId -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EightOctetKeyId -> ByteString
forall n o. Newtype n o => n -> o
unpack

-- FIXME: read-show
instance Read EightOctetKeyId where
  readsPrec :: Int -> ReadS EightOctetKeyId
readsPrec _ =
    ([(Word8, String)] -> (EightOctetKeyId, String))
-> [[(Word8, String)]] -> [(EightOctetKeyId, String)]
forall a b. (a -> b) -> [a] -> [b]
map ((ByteString -> EightOctetKeyId
EightOctetKeyId (ByteString -> EightOctetKeyId)
-> ([Word8] -> ByteString) -> [Word8] -> EightOctetKeyId
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Word8] -> ByteString
BL.pack ([Word8] -> EightOctetKeyId)
-> ([String] -> String)
-> ([Word8], [String])
-> (EightOctetKeyId, String)
forall (a :: * -> * -> *) b c b' c'.
Arrow a =>
a b c -> a b' c' -> a (b, b') (c, c')
*** [String] -> String
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat) (([Word8], [String]) -> (EightOctetKeyId, String))
-> ([(Word8, String)] -> ([Word8], [String]))
-> [(Word8, String)]
-> (EightOctetKeyId, String)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [(Word8, String)] -> ([Word8], [String])
forall a b. [(a, b)] -> ([a], [b])
unzip) ([[(Word8, String)]] -> [(EightOctetKeyId, String)])
-> (String -> [[(Word8, String)]]) -> ReadS EightOctetKeyId
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> [(Word8, String)] -> [[(Word8, String)]]
forall e. Int -> [e] -> [[e]]
chunksOf 8 ([(Word8, String)] -> [[(Word8, String)]])
-> (String -> [(Word8, String)]) -> String -> [[(Word8, String)]]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> [(Word8, String)]
hexToW8s

instance Hashable EightOctetKeyId

instance A.ToJSON EightOctetKeyId where
  toJSON :: EightOctetKeyId -> Value
toJSON e :: EightOctetKeyId
e = [Pair] -> Value
object [String -> Text
T.pack "eoki" Text -> String -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (ByteString -> String
bsToHexUpper (ByteString -> String)
-> (EightOctetKeyId -> ByteString) -> EightOctetKeyId -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. EightOctetKeyId -> ByteString
forall n o. Newtype n o => n -> o
unpack) EightOctetKeyId
e]

instance A.FromJSON EightOctetKeyId where
  parseJSON :: Value -> Parser EightOctetKeyId
parseJSON (A.Object v :: Object
v) = ByteString -> EightOctetKeyId
EightOctetKeyId (ByteString -> EightOctetKeyId)
-> (String -> ByteString) -> String -> EightOctetKeyId
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ByteString
forall a. Read a => String -> a
read (String -> EightOctetKeyId)
-> Parser String -> Parser EightOctetKeyId
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser String
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "eoki"
  parseJSON _ = Parser EightOctetKeyId
forall (m :: * -> *) a. MonadPlus m => m a
mzero

newtype NotationName =
  NotationName
    { NotationName -> ByteString
unNotationName :: ByteString
    }
  deriving (Typeable NotationName
Constr
DataType
Typeable NotationName =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> NotationName -> c NotationName)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c NotationName)
-> (NotationName -> Constr)
-> (NotationName -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c NotationName))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c NotationName))
-> ((forall b. Data b => b -> b) -> NotationName -> NotationName)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> NotationName -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> NotationName -> r)
-> (forall u. (forall d. Data d => d -> u) -> NotationName -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> NotationName -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> NotationName -> m NotationName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NotationName -> m NotationName)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NotationName -> m NotationName)
-> Data NotationName
NotationName -> Constr
NotationName -> DataType
(forall b. Data b => b -> b) -> NotationName -> NotationName
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationName -> c NotationName
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationName
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) -> NotationName -> u
forall u. (forall d. Data d => d -> u) -> NotationName -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NotationName -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NotationName -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NotationName -> m NotationName
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NotationName -> m NotationName
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationName
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationName -> c NotationName
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NotationName)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NotationName)
$cNotationName :: Constr
$tNotationName :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> NotationName -> m NotationName
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NotationName -> m NotationName
gmapMp :: (forall d. Data d => d -> m d) -> NotationName -> m NotationName
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NotationName -> m NotationName
gmapM :: (forall d. Data d => d -> m d) -> NotationName -> m NotationName
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NotationName -> m NotationName
gmapQi :: Int -> (forall d. Data d => d -> u) -> NotationName -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NotationName -> u
gmapQ :: (forall d. Data d => d -> u) -> NotationName -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> NotationName -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NotationName -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NotationName -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NotationName -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NotationName -> r
gmapT :: (forall b. Data b => b -> b) -> NotationName -> NotationName
$cgmapT :: (forall b. Data b => b -> b) -> NotationName -> NotationName
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NotationName)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NotationName)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c NotationName)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NotationName)
dataTypeOf :: NotationName -> DataType
$cdataTypeOf :: NotationName -> DataType
toConstr :: NotationName -> Constr
$ctoConstr :: NotationName -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationName
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationName
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationName -> c NotationName
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationName -> c NotationName
$cp1Data :: Typeable NotationName
Data, NotationName -> NotationName -> Bool
(NotationName -> NotationName -> Bool)
-> (NotationName -> NotationName -> Bool) -> Eq NotationName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotationName -> NotationName -> Bool
$c/= :: NotationName -> NotationName -> Bool
== :: NotationName -> NotationName -> Bool
$c== :: NotationName -> NotationName -> Bool
Eq, (forall x. NotationName -> Rep NotationName x)
-> (forall x. Rep NotationName x -> NotationName)
-> Generic NotationName
forall x. Rep NotationName x -> NotationName
forall x. NotationName -> Rep NotationName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NotationName x -> NotationName
$cfrom :: forall x. NotationName -> Rep NotationName x
Generic, Int -> NotationName -> Int
NotationName -> Int
(Int -> NotationName -> Int)
-> (NotationName -> Int) -> Hashable NotationName
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: NotationName -> Int
$chash :: NotationName -> Int
hashWithSalt :: Int -> NotationName -> Int
$chashWithSalt :: Int -> NotationName -> Int
Hashable, Eq NotationName
Eq NotationName =>
(NotationName -> NotationName -> Ordering)
-> (NotationName -> NotationName -> Bool)
-> (NotationName -> NotationName -> Bool)
-> (NotationName -> NotationName -> Bool)
-> (NotationName -> NotationName -> Bool)
-> (NotationName -> NotationName -> NotationName)
-> (NotationName -> NotationName -> NotationName)
-> Ord NotationName
NotationName -> NotationName -> Bool
NotationName -> NotationName -> Ordering
NotationName -> NotationName -> NotationName
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
min :: NotationName -> NotationName -> NotationName
$cmin :: NotationName -> NotationName -> NotationName
max :: NotationName -> NotationName -> NotationName
$cmax :: NotationName -> NotationName -> NotationName
>= :: NotationName -> NotationName -> Bool
$c>= :: NotationName -> NotationName -> Bool
> :: NotationName -> NotationName -> Bool
$c> :: NotationName -> NotationName -> Bool
<= :: NotationName -> NotationName -> Bool
$c<= :: NotationName -> NotationName -> Bool
< :: NotationName -> NotationName -> Bool
$c< :: NotationName -> NotationName -> Bool
compare :: NotationName -> NotationName -> Ordering
$ccompare :: NotationName -> NotationName -> Ordering
$cp1Ord :: Eq NotationName
Ord, Int -> NotationName -> ShowS
[NotationName] -> ShowS
NotationName -> String
(Int -> NotationName -> ShowS)
-> (NotationName -> String)
-> ([NotationName] -> ShowS)
-> Show NotationName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotationName] -> ShowS
$cshowList :: [NotationName] -> ShowS
show :: NotationName -> String
$cshow :: NotationName -> String
showsPrec :: Int -> NotationName -> ShowS
$cshowsPrec :: Int -> NotationName -> ShowS
Show, Typeable)

instance Pretty NotationName where
  pretty :: NotationName -> Doc ann
pretty = ByteString -> Doc ann
forall ann. ByteString -> Doc ann
prettyLBS (ByteString -> Doc ann)
-> (NotationName -> ByteString) -> NotationName -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NotationName -> ByteString
unNotationName

instance Newtype NotationName ByteString where
  pack :: ByteString -> NotationName
pack = ByteString -> NotationName
NotationName
  unpack :: NotationName -> ByteString
unpack (NotationName nn :: ByteString
nn) = ByteString
nn

instance A.ToJSON NotationName where
  toJSON :: NotationName -> Value
toJSON nn :: NotationName
nn = [Pair] -> Value
object [String -> Text
T.pack "notationname" Text -> String -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= ByteString -> String
forall a. Show a => a -> String
show (NotationName -> ByteString
forall n o. Newtype n o => n -> o
unpack NotationName
nn)]

instance A.FromJSON NotationName where
  parseJSON :: Value -> Parser NotationName
parseJSON (A.Object v :: Object
v) = ByteString -> NotationName
NotationName (ByteString -> NotationName)
-> (String -> ByteString) -> String -> NotationName
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ByteString
forall a. Read a => String -> a
read (String -> NotationName) -> Parser String -> Parser NotationName
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser String
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "notationname"
  parseJSON _ = Parser NotationName
forall (m :: * -> *) a. MonadPlus m => m a
mzero

newtype NotationValue =
  NotationValue
    { NotationValue -> ByteString
unNotationValue :: ByteString
    }
  deriving (Typeable NotationValue
Constr
DataType
Typeable NotationValue =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> NotationValue -> c NotationValue)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c NotationValue)
-> (NotationValue -> Constr)
-> (NotationValue -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c NotationValue))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c NotationValue))
-> ((forall b. Data b => b -> b) -> NotationValue -> NotationValue)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> NotationValue -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> NotationValue -> r)
-> (forall u. (forall d. Data d => d -> u) -> NotationValue -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> NotationValue -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> NotationValue -> m NotationValue)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NotationValue -> m NotationValue)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> NotationValue -> m NotationValue)
-> Data NotationValue
NotationValue -> Constr
NotationValue -> DataType
(forall b. Data b => b -> b) -> NotationValue -> NotationValue
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationValue -> c NotationValue
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationValue
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) -> NotationValue -> u
forall u. (forall d. Data d => d -> u) -> NotationValue -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NotationValue -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NotationValue -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NotationValue -> m NotationValue
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NotationValue -> m NotationValue
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationValue
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationValue -> c NotationValue
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NotationValue)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NotationValue)
$cNotationValue :: Constr
$tNotationValue :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> NotationValue -> m NotationValue
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NotationValue -> m NotationValue
gmapMp :: (forall d. Data d => d -> m d) -> NotationValue -> m NotationValue
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> NotationValue -> m NotationValue
gmapM :: (forall d. Data d => d -> m d) -> NotationValue -> m NotationValue
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> NotationValue -> m NotationValue
gmapQi :: Int -> (forall d. Data d => d -> u) -> NotationValue -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> NotationValue -> u
gmapQ :: (forall d. Data d => d -> u) -> NotationValue -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> NotationValue -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NotationValue -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> NotationValue -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NotationValue -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> NotationValue -> r
gmapT :: (forall b. Data b => b -> b) -> NotationValue -> NotationValue
$cgmapT :: (forall b. Data b => b -> b) -> NotationValue -> NotationValue
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NotationValue)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c NotationValue)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c NotationValue)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c NotationValue)
dataTypeOf :: NotationValue -> DataType
$cdataTypeOf :: NotationValue -> DataType
toConstr :: NotationValue -> Constr
$ctoConstr :: NotationValue -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationValue
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c NotationValue
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationValue -> c NotationValue
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> NotationValue -> c NotationValue
$cp1Data :: Typeable NotationValue
Data, NotationValue -> NotationValue -> Bool
(NotationValue -> NotationValue -> Bool)
-> (NotationValue -> NotationValue -> Bool) -> Eq NotationValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotationValue -> NotationValue -> Bool
$c/= :: NotationValue -> NotationValue -> Bool
== :: NotationValue -> NotationValue -> Bool
$c== :: NotationValue -> NotationValue -> Bool
Eq, (forall x. NotationValue -> Rep NotationValue x)
-> (forall x. Rep NotationValue x -> NotationValue)
-> Generic NotationValue
forall x. Rep NotationValue x -> NotationValue
forall x. NotationValue -> Rep NotationValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NotationValue x -> NotationValue
$cfrom :: forall x. NotationValue -> Rep NotationValue x
Generic, Int -> NotationValue -> Int
NotationValue -> Int
(Int -> NotationValue -> Int)
-> (NotationValue -> Int) -> Hashable NotationValue
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: NotationValue -> Int
$chash :: NotationValue -> Int
hashWithSalt :: Int -> NotationValue -> Int
$chashWithSalt :: Int -> NotationValue -> Int
Hashable, Eq NotationValue
Eq NotationValue =>
(NotationValue -> NotationValue -> Ordering)
-> (NotationValue -> NotationValue -> Bool)
-> (NotationValue -> NotationValue -> Bool)
-> (NotationValue -> NotationValue -> Bool)
-> (NotationValue -> NotationValue -> Bool)
-> (NotationValue -> NotationValue -> NotationValue)
-> (NotationValue -> NotationValue -> NotationValue)
-> Ord NotationValue
NotationValue -> NotationValue -> Bool
NotationValue -> NotationValue -> Ordering
NotationValue -> NotationValue -> NotationValue
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
min :: NotationValue -> NotationValue -> NotationValue
$cmin :: NotationValue -> NotationValue -> NotationValue
max :: NotationValue -> NotationValue -> NotationValue
$cmax :: NotationValue -> NotationValue -> NotationValue
>= :: NotationValue -> NotationValue -> Bool
$c>= :: NotationValue -> NotationValue -> Bool
> :: NotationValue -> NotationValue -> Bool
$c> :: NotationValue -> NotationValue -> Bool
<= :: NotationValue -> NotationValue -> Bool
$c<= :: NotationValue -> NotationValue -> Bool
< :: NotationValue -> NotationValue -> Bool
$c< :: NotationValue -> NotationValue -> Bool
compare :: NotationValue -> NotationValue -> Ordering
$ccompare :: NotationValue -> NotationValue -> Ordering
$cp1Ord :: Eq NotationValue
Ord, Int -> NotationValue -> ShowS
[NotationValue] -> ShowS
NotationValue -> String
(Int -> NotationValue -> ShowS)
-> (NotationValue -> String)
-> ([NotationValue] -> ShowS)
-> Show NotationValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotationValue] -> ShowS
$cshowList :: [NotationValue] -> ShowS
show :: NotationValue -> String
$cshow :: NotationValue -> String
showsPrec :: Int -> NotationValue -> ShowS
$cshowsPrec :: Int -> NotationValue -> ShowS
Show, Typeable)

instance Pretty NotationValue where
  pretty :: NotationValue -> Doc ann
pretty = ByteString -> Doc ann
forall ann. ByteString -> Doc ann
prettyLBS (ByteString -> Doc ann)
-> (NotationValue -> ByteString) -> NotationValue -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NotationValue -> ByteString
unNotationValue

instance Newtype NotationValue ByteString where
  pack :: ByteString -> NotationValue
pack = ByteString -> NotationValue
NotationValue
  unpack :: NotationValue -> ByteString
unpack (NotationValue nv :: ByteString
nv) = ByteString
nv

instance A.ToJSON NotationValue where
  toJSON :: NotationValue -> Value
toJSON nv :: NotationValue
nv = [Pair] -> Value
object [String -> Text
T.pack "notationvalue" Text -> String -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= ByteString -> String
forall a. Show a => a -> String
show (NotationValue -> ByteString
forall n o. Newtype n o => n -> o
unpack NotationValue
nv)]

instance A.FromJSON NotationValue where
  parseJSON :: Value -> Parser NotationValue
parseJSON (A.Object v :: Object
v) =
    ByteString -> NotationValue
NotationValue (ByteString -> NotationValue)
-> (String -> ByteString) -> String -> NotationValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> ByteString
forall a. Read a => String -> a
read (String -> NotationValue) -> Parser String -> Parser NotationValue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser String
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "notationvalue"
  parseJSON _ = Parser NotationValue
forall (m :: * -> *) a. MonadPlus m => m a
mzero

data HashAlgorithm
  = DeprecatedMD5
  | SHA1
  | RIPEMD160
  | SHA256
  | SHA384
  | SHA512
  | SHA224
  | OtherHA Word8
  deriving (Typeable HashAlgorithm
Constr
DataType
Typeable HashAlgorithm =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> HashAlgorithm -> c HashAlgorithm)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c HashAlgorithm)
-> (HashAlgorithm -> Constr)
-> (HashAlgorithm -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c HashAlgorithm))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c HashAlgorithm))
-> ((forall b. Data b => b -> b) -> HashAlgorithm -> HashAlgorithm)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> HashAlgorithm -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> HashAlgorithm -> r)
-> (forall u. (forall d. Data d => d -> u) -> HashAlgorithm -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> HashAlgorithm -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm)
-> Data HashAlgorithm
HashAlgorithm -> Constr
HashAlgorithm -> DataType
(forall b. Data b => b -> b) -> HashAlgorithm -> HashAlgorithm
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HashAlgorithm -> c HashAlgorithm
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HashAlgorithm
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) -> HashAlgorithm -> u
forall u. (forall d. Data d => d -> u) -> HashAlgorithm -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HashAlgorithm -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HashAlgorithm -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HashAlgorithm
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HashAlgorithm -> c HashAlgorithm
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HashAlgorithm)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HashAlgorithm)
$cOtherHA :: Constr
$cSHA224 :: Constr
$cSHA512 :: Constr
$cSHA384 :: Constr
$cSHA256 :: Constr
$cRIPEMD160 :: Constr
$cSHA1 :: Constr
$cDeprecatedMD5 :: Constr
$tHashAlgorithm :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm
gmapMp :: (forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm
gmapM :: (forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> HashAlgorithm -> m HashAlgorithm
gmapQi :: Int -> (forall d. Data d => d -> u) -> HashAlgorithm -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> HashAlgorithm -> u
gmapQ :: (forall d. Data d => d -> u) -> HashAlgorithm -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> HashAlgorithm -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HashAlgorithm -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> HashAlgorithm -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HashAlgorithm -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> HashAlgorithm -> r
gmapT :: (forall b. Data b => b -> b) -> HashAlgorithm -> HashAlgorithm
$cgmapT :: (forall b. Data b => b -> b) -> HashAlgorithm -> HashAlgorithm
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HashAlgorithm)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c HashAlgorithm)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c HashAlgorithm)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c HashAlgorithm)
dataTypeOf :: HashAlgorithm -> DataType
$cdataTypeOf :: HashAlgorithm -> DataType
toConstr :: HashAlgorithm -> Constr
$ctoConstr :: HashAlgorithm -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HashAlgorithm
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c HashAlgorithm
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HashAlgorithm -> c HashAlgorithm
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> HashAlgorithm -> c HashAlgorithm
$cp1Data :: Typeable HashAlgorithm
Data, (forall x. HashAlgorithm -> Rep HashAlgorithm x)
-> (forall x. Rep HashAlgorithm x -> HashAlgorithm)
-> Generic HashAlgorithm
forall x. Rep HashAlgorithm x -> HashAlgorithm
forall x. HashAlgorithm -> Rep HashAlgorithm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HashAlgorithm x -> HashAlgorithm
$cfrom :: forall x. HashAlgorithm -> Rep HashAlgorithm x
Generic, Int -> HashAlgorithm -> ShowS
[HashAlgorithm] -> ShowS
HashAlgorithm -> String
(Int -> HashAlgorithm -> ShowS)
-> (HashAlgorithm -> String)
-> ([HashAlgorithm] -> ShowS)
-> Show HashAlgorithm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HashAlgorithm] -> ShowS
$cshowList :: [HashAlgorithm] -> ShowS
show :: HashAlgorithm -> String
$cshow :: HashAlgorithm -> String
showsPrec :: Int -> HashAlgorithm -> ShowS
$cshowsPrec :: Int -> HashAlgorithm -> ShowS
Show, Typeable)

instance Eq HashAlgorithm where
  == :: HashAlgorithm -> HashAlgorithm -> Bool
(==) a :: HashAlgorithm
a b :: HashAlgorithm
b = HashAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal HashAlgorithm
a Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
== HashAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal HashAlgorithm
b

instance Ord HashAlgorithm where
  compare :: HashAlgorithm -> HashAlgorithm -> Ordering
compare = (HashAlgorithm -> Word8)
-> HashAlgorithm -> HashAlgorithm -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing HashAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal

instance FutureVal HashAlgorithm where
  fromFVal :: HashAlgorithm -> Word8
fromFVal DeprecatedMD5 = 1
  fromFVal SHA1 = 2
  fromFVal RIPEMD160 = 3
  fromFVal SHA256 = 8
  fromFVal SHA384 = 9
  fromFVal SHA512 = 10
  fromFVal SHA224 = 11
  fromFVal (OtherHA o :: Word8
o) = Word8
o
  toFVal :: Word8 -> HashAlgorithm
toFVal 1 = HashAlgorithm
DeprecatedMD5
  toFVal 2 = HashAlgorithm
SHA1
  toFVal 3 = HashAlgorithm
RIPEMD160
  toFVal 8 = HashAlgorithm
SHA256
  toFVal 9 = HashAlgorithm
SHA384
  toFVal 10 = HashAlgorithm
SHA512
  toFVal 11 = HashAlgorithm
SHA224
  toFVal o :: Word8
o = Word8 -> HashAlgorithm
OtherHA Word8
o

instance Hashable HashAlgorithm

instance Pretty HashAlgorithm where
  pretty :: HashAlgorithm -> Doc ann
pretty DeprecatedMD5 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "(deprecated) MD5"
  pretty SHA1 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "SHA-1"
  pretty RIPEMD160 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "RIPEMD-160"
  pretty SHA256 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "SHA-256"
  pretty SHA384 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "SHA-384"
  pretty SHA512 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "SHA-512"
  pretty SHA224 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "SHA-224"
  pretty (OtherHA ha :: Word8
ha) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown hash algorithm type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
ha

$(ATH.deriveJSON ATH.defaultOptions ''HashAlgorithm)

data CompressionAlgorithm
  = Uncompressed
  | ZIP
  | ZLIB
  | BZip2
  | OtherCA Word8
  deriving (Int -> CompressionAlgorithm -> ShowS
[CompressionAlgorithm] -> ShowS
CompressionAlgorithm -> String
(Int -> CompressionAlgorithm -> ShowS)
-> (CompressionAlgorithm -> String)
-> ([CompressionAlgorithm] -> ShowS)
-> Show CompressionAlgorithm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CompressionAlgorithm] -> ShowS
$cshowList :: [CompressionAlgorithm] -> ShowS
show :: CompressionAlgorithm -> String
$cshow :: CompressionAlgorithm -> String
showsPrec :: Int -> CompressionAlgorithm -> ShowS
$cshowsPrec :: Int -> CompressionAlgorithm -> ShowS
Show, Typeable CompressionAlgorithm
Constr
DataType
Typeable CompressionAlgorithm =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> CompressionAlgorithm
 -> c CompressionAlgorithm)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c CompressionAlgorithm)
-> (CompressionAlgorithm -> Constr)
-> (CompressionAlgorithm -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c CompressionAlgorithm))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c CompressionAlgorithm))
-> ((forall b. Data b => b -> b)
    -> CompressionAlgorithm -> CompressionAlgorithm)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> CompressionAlgorithm -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> CompressionAlgorithm -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> CompressionAlgorithm -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> CompressionAlgorithm -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> CompressionAlgorithm -> m CompressionAlgorithm)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> CompressionAlgorithm -> m CompressionAlgorithm)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> CompressionAlgorithm -> m CompressionAlgorithm)
-> Data CompressionAlgorithm
CompressionAlgorithm -> Constr
CompressionAlgorithm -> DataType
(forall b. Data b => b -> b)
-> CompressionAlgorithm -> CompressionAlgorithm
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CompressionAlgorithm
-> c CompressionAlgorithm
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CompressionAlgorithm
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) -> CompressionAlgorithm -> u
forall u.
(forall d. Data d => d -> u) -> CompressionAlgorithm -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CompressionAlgorithm -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CompressionAlgorithm -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CompressionAlgorithm -> m CompressionAlgorithm
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressionAlgorithm -> m CompressionAlgorithm
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CompressionAlgorithm
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CompressionAlgorithm
-> c CompressionAlgorithm
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CompressionAlgorithm)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CompressionAlgorithm)
$cOtherCA :: Constr
$cBZip2 :: Constr
$cZLIB :: Constr
$cZIP :: Constr
$cUncompressed :: Constr
$tCompressionAlgorithm :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> CompressionAlgorithm -> m CompressionAlgorithm
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressionAlgorithm -> m CompressionAlgorithm
gmapMp :: (forall d. Data d => d -> m d)
-> CompressionAlgorithm -> m CompressionAlgorithm
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> CompressionAlgorithm -> m CompressionAlgorithm
gmapM :: (forall d. Data d => d -> m d)
-> CompressionAlgorithm -> m CompressionAlgorithm
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> CompressionAlgorithm -> m CompressionAlgorithm
gmapQi :: Int -> (forall d. Data d => d -> u) -> CompressionAlgorithm -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> CompressionAlgorithm -> u
gmapQ :: (forall d. Data d => d -> u) -> CompressionAlgorithm -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> CompressionAlgorithm -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CompressionAlgorithm -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> CompressionAlgorithm -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CompressionAlgorithm -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> CompressionAlgorithm -> r
gmapT :: (forall b. Data b => b -> b)
-> CompressionAlgorithm -> CompressionAlgorithm
$cgmapT :: (forall b. Data b => b -> b)
-> CompressionAlgorithm -> CompressionAlgorithm
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CompressionAlgorithm)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c CompressionAlgorithm)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c CompressionAlgorithm)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c CompressionAlgorithm)
dataTypeOf :: CompressionAlgorithm -> DataType
$cdataTypeOf :: CompressionAlgorithm -> DataType
toConstr :: CompressionAlgorithm -> Constr
$ctoConstr :: CompressionAlgorithm -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CompressionAlgorithm
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c CompressionAlgorithm
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CompressionAlgorithm
-> c CompressionAlgorithm
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> CompressionAlgorithm
-> c CompressionAlgorithm
$cp1Data :: Typeable CompressionAlgorithm
Data, (forall x. CompressionAlgorithm -> Rep CompressionAlgorithm x)
-> (forall x. Rep CompressionAlgorithm x -> CompressionAlgorithm)
-> Generic CompressionAlgorithm
forall x. Rep CompressionAlgorithm x -> CompressionAlgorithm
forall x. CompressionAlgorithm -> Rep CompressionAlgorithm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CompressionAlgorithm x -> CompressionAlgorithm
$cfrom :: forall x. CompressionAlgorithm -> Rep CompressionAlgorithm x
Generic, Typeable)

instance Eq CompressionAlgorithm where
  == :: CompressionAlgorithm -> CompressionAlgorithm -> Bool
(==) a :: CompressionAlgorithm
a b :: CompressionAlgorithm
b = CompressionAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal CompressionAlgorithm
a Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
== CompressionAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal CompressionAlgorithm
b

instance Ord CompressionAlgorithm where
  compare :: CompressionAlgorithm -> CompressionAlgorithm -> Ordering
compare = (CompressionAlgorithm -> Word8)
-> CompressionAlgorithm -> CompressionAlgorithm -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing CompressionAlgorithm -> Word8
forall a. FutureVal a => a -> Word8
fromFVal

instance FutureVal CompressionAlgorithm where
  fromFVal :: CompressionAlgorithm -> Word8
fromFVal Uncompressed = 0
  fromFVal ZIP = 1
  fromFVal ZLIB = 2
  fromFVal BZip2 = 3
  fromFVal (OtherCA o :: Word8
o) = Word8
o
  toFVal :: Word8 -> CompressionAlgorithm
toFVal 0 = CompressionAlgorithm
Uncompressed
  toFVal 1 = CompressionAlgorithm
ZIP
  toFVal 2 = CompressionAlgorithm
ZLIB
  toFVal 3 = CompressionAlgorithm
BZip2
  toFVal o :: Word8
o = Word8 -> CompressionAlgorithm
OtherCA Word8
o

instance Hashable CompressionAlgorithm

instance Pretty CompressionAlgorithm where
  pretty :: CompressionAlgorithm -> Doc ann
pretty Uncompressed = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "uncompressed"
  pretty ZIP = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "ZIP"
  pretty ZLIB = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "zlib"
  pretty BZip2 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "bzip2"
  pretty (OtherCA ca :: Word8
ca) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown compression algorithm type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
ca

$(ATH.deriveJSON ATH.defaultOptions ''CompressionAlgorithm)

data KSPFlag
  = NoModify
  | KSPOther Int
  deriving (Typeable KSPFlag
Constr
DataType
Typeable KSPFlag =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> KSPFlag -> c KSPFlag)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c KSPFlag)
-> (KSPFlag -> Constr)
-> (KSPFlag -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c KSPFlag))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KSPFlag))
-> ((forall b. Data b => b -> b) -> KSPFlag -> KSPFlag)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> KSPFlag -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> KSPFlag -> r)
-> (forall u. (forall d. Data d => d -> u) -> KSPFlag -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> KSPFlag -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag)
-> Data KSPFlag
KSPFlag -> Constr
KSPFlag -> DataType
(forall b. Data b => b -> b) -> KSPFlag -> KSPFlag
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KSPFlag -> c KSPFlag
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KSPFlag
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) -> KSPFlag -> u
forall u. (forall d. Data d => d -> u) -> KSPFlag -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KSPFlag -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KSPFlag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KSPFlag
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KSPFlag -> c KSPFlag
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KSPFlag)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KSPFlag)
$cKSPOther :: Constr
$cNoModify :: Constr
$tKSPFlag :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag
gmapMp :: (forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag
gmapM :: (forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KSPFlag -> m KSPFlag
gmapQi :: Int -> (forall d. Data d => d -> u) -> KSPFlag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> KSPFlag -> u
gmapQ :: (forall d. Data d => d -> u) -> KSPFlag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> KSPFlag -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KSPFlag -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KSPFlag -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KSPFlag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KSPFlag -> r
gmapT :: (forall b. Data b => b -> b) -> KSPFlag -> KSPFlag
$cgmapT :: (forall b. Data b => b -> b) -> KSPFlag -> KSPFlag
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KSPFlag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KSPFlag)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c KSPFlag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KSPFlag)
dataTypeOf :: KSPFlag -> DataType
$cdataTypeOf :: KSPFlag -> DataType
toConstr :: KSPFlag -> Constr
$ctoConstr :: KSPFlag -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KSPFlag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KSPFlag
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KSPFlag -> c KSPFlag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KSPFlag -> c KSPFlag
$cp1Data :: Typeable KSPFlag
Data, (forall x. KSPFlag -> Rep KSPFlag x)
-> (forall x. Rep KSPFlag x -> KSPFlag) -> Generic KSPFlag
forall x. Rep KSPFlag x -> KSPFlag
forall x. KSPFlag -> Rep KSPFlag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KSPFlag x -> KSPFlag
$cfrom :: forall x. KSPFlag -> Rep KSPFlag x
Generic, Int -> KSPFlag -> ShowS
[KSPFlag] -> ShowS
KSPFlag -> String
(Int -> KSPFlag -> ShowS)
-> (KSPFlag -> String) -> ([KSPFlag] -> ShowS) -> Show KSPFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KSPFlag] -> ShowS
$cshowList :: [KSPFlag] -> ShowS
show :: KSPFlag -> String
$cshow :: KSPFlag -> String
showsPrec :: Int -> KSPFlag -> ShowS
$cshowsPrec :: Int -> KSPFlag -> ShowS
Show, Typeable)

instance Eq KSPFlag where
  == :: KSPFlag -> KSPFlag -> Bool
(==) a :: KSPFlag
a b :: KSPFlag
b = KSPFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag KSPFlag
a Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== KSPFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag KSPFlag
b

instance Ord KSPFlag where
  compare :: KSPFlag -> KSPFlag -> Ordering
compare = (KSPFlag -> Int) -> KSPFlag -> KSPFlag -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing KSPFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag

instance FutureFlag KSPFlag where
  fromFFlag :: KSPFlag -> Int
fromFFlag NoModify = 0
  fromFFlag (KSPOther i :: Int
i) = Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i
  toFFlag :: Int -> KSPFlag
toFFlag 0 = KSPFlag
NoModify
  toFFlag i :: Int
i = Int -> KSPFlag
KSPOther (Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i)

instance Hashable KSPFlag

instance Pretty KSPFlag where
  pretty :: KSPFlag -> Doc ann
pretty NoModify = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "no-modify"
  pretty (KSPOther o :: Int
o) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown keyserver preference flag type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Int -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Int
o

$(ATH.deriveJSON ATH.defaultOptions ''KSPFlag)

data KeyFlag
  = GroupKey
  | AuthKey
  | SplitKey
  | EncryptStorageKey
  | EncryptCommunicationsKey
  | SignDataKey
  | CertifyKeysKey
  | KFOther Int
  deriving (Typeable KeyFlag
Constr
DataType
Typeable KeyFlag =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> KeyFlag -> c KeyFlag)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c KeyFlag)
-> (KeyFlag -> Constr)
-> (KeyFlag -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c KeyFlag))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyFlag))
-> ((forall b. Data b => b -> b) -> KeyFlag -> KeyFlag)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> KeyFlag -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> KeyFlag -> r)
-> (forall u. (forall d. Data d => d -> u) -> KeyFlag -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> KeyFlag -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag)
-> Data KeyFlag
KeyFlag -> Constr
KeyFlag -> DataType
(forall b. Data b => b -> b) -> KeyFlag -> KeyFlag
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KeyFlag -> c KeyFlag
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KeyFlag
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) -> KeyFlag -> u
forall u. (forall d. Data d => d -> u) -> KeyFlag -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KeyFlag -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KeyFlag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KeyFlag
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KeyFlag -> c KeyFlag
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KeyFlag)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyFlag)
$cKFOther :: Constr
$cCertifyKeysKey :: Constr
$cSignDataKey :: Constr
$cEncryptCommunicationsKey :: Constr
$cEncryptStorageKey :: Constr
$cSplitKey :: Constr
$cAuthKey :: Constr
$cGroupKey :: Constr
$tKeyFlag :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag
gmapMp :: (forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag
gmapM :: (forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KeyFlag -> m KeyFlag
gmapQi :: Int -> (forall d. Data d => d -> u) -> KeyFlag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> KeyFlag -> u
gmapQ :: (forall d. Data d => d -> u) -> KeyFlag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> KeyFlag -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KeyFlag -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KeyFlag -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KeyFlag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KeyFlag -> r
gmapT :: (forall b. Data b => b -> b) -> KeyFlag -> KeyFlag
$cgmapT :: (forall b. Data b => b -> b) -> KeyFlag -> KeyFlag
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyFlag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyFlag)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c KeyFlag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KeyFlag)
dataTypeOf :: KeyFlag -> DataType
$cdataTypeOf :: KeyFlag -> DataType
toConstr :: KeyFlag -> Constr
$ctoConstr :: KeyFlag -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KeyFlag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KeyFlag
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KeyFlag -> c KeyFlag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KeyFlag -> c KeyFlag
$cp1Data :: Typeable KeyFlag
Data, (forall x. KeyFlag -> Rep KeyFlag x)
-> (forall x. Rep KeyFlag x -> KeyFlag) -> Generic KeyFlag
forall x. Rep KeyFlag x -> KeyFlag
forall x. KeyFlag -> Rep KeyFlag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeyFlag x -> KeyFlag
$cfrom :: forall x. KeyFlag -> Rep KeyFlag x
Generic, Int -> KeyFlag -> ShowS
[KeyFlag] -> ShowS
KeyFlag -> String
(Int -> KeyFlag -> ShowS)
-> (KeyFlag -> String) -> ([KeyFlag] -> ShowS) -> Show KeyFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyFlag] -> ShowS
$cshowList :: [KeyFlag] -> ShowS
show :: KeyFlag -> String
$cshow :: KeyFlag -> String
showsPrec :: Int -> KeyFlag -> ShowS
$cshowsPrec :: Int -> KeyFlag -> ShowS
Show, Typeable)

instance Eq KeyFlag where
  == :: KeyFlag -> KeyFlag -> Bool
(==) a :: KeyFlag
a b :: KeyFlag
b = KeyFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag KeyFlag
a Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== KeyFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag KeyFlag
b

instance Ord KeyFlag where
  compare :: KeyFlag -> KeyFlag -> Ordering
compare = (KeyFlag -> Int) -> KeyFlag -> KeyFlag -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing KeyFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag

instance FutureFlag KeyFlag where
  fromFFlag :: KeyFlag -> Int
fromFFlag GroupKey = 0
  fromFFlag AuthKey = 2
  fromFFlag SplitKey = 3
  fromFFlag EncryptStorageKey = 4
  fromFFlag EncryptCommunicationsKey = 5
  fromFFlag SignDataKey = 6
  fromFFlag CertifyKeysKey = 7
  fromFFlag (KFOther i :: Int
i) = Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i
  toFFlag :: Int -> KeyFlag
toFFlag 0 = KeyFlag
GroupKey
  toFFlag 2 = KeyFlag
AuthKey
  toFFlag 3 = KeyFlag
SplitKey
  toFFlag 4 = KeyFlag
EncryptStorageKey
  toFFlag 5 = KeyFlag
EncryptCommunicationsKey
  toFFlag 6 = KeyFlag
SignDataKey
  toFFlag 7 = KeyFlag
CertifyKeysKey
  toFFlag i :: Int
i = Int -> KeyFlag
KFOther (Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i)

instance Hashable KeyFlag

instance Pretty KeyFlag where
  pretty :: KeyFlag -> Doc ann
pretty GroupKey = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "group"
  pretty AuthKey = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "auth"
  pretty SplitKey = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "split"
  pretty EncryptStorageKey = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "encrypt-storage"
  pretty EncryptCommunicationsKey = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "encrypt-communications"
  pretty SignDataKey = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "sign-data"
  pretty CertifyKeysKey = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "certify-keys"
  pretty (KFOther o :: Int
o) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown key flag type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Int -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Int
o

$(ATH.deriveJSON ATH.defaultOptions ''KeyFlag)

data RevocationCode
  = NoReason
  | KeySuperseded
  | KeyMaterialCompromised
  | KeyRetiredAndNoLongerUsed
  | UserIdInfoNoLongerValid
  | RCoOther Word8
  deriving (Typeable RevocationCode
Constr
DataType
Typeable RevocationCode =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> RevocationCode -> c RevocationCode)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c RevocationCode)
-> (RevocationCode -> Constr)
-> (RevocationCode -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c RevocationCode))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c RevocationCode))
-> ((forall b. Data b => b -> b)
    -> RevocationCode -> RevocationCode)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> RevocationCode -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> RevocationCode -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> RevocationCode -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> RevocationCode -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> RevocationCode -> m RevocationCode)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RevocationCode -> m RevocationCode)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> RevocationCode -> m RevocationCode)
-> Data RevocationCode
RevocationCode -> Constr
RevocationCode -> DataType
(forall b. Data b => b -> b) -> RevocationCode -> RevocationCode
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RevocationCode -> c RevocationCode
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RevocationCode
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) -> RevocationCode -> u
forall u. (forall d. Data d => d -> u) -> RevocationCode -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationCode -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationCode -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> RevocationCode -> m RevocationCode
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RevocationCode -> m RevocationCode
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RevocationCode
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RevocationCode -> c RevocationCode
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RevocationCode)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RevocationCode)
$cRCoOther :: Constr
$cUserIdInfoNoLongerValid :: Constr
$cKeyRetiredAndNoLongerUsed :: Constr
$cKeyMaterialCompromised :: Constr
$cKeySuperseded :: Constr
$cNoReason :: Constr
$tRevocationCode :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> RevocationCode -> m RevocationCode
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RevocationCode -> m RevocationCode
gmapMp :: (forall d. Data d => d -> m d)
-> RevocationCode -> m RevocationCode
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> RevocationCode -> m RevocationCode
gmapM :: (forall d. Data d => d -> m d)
-> RevocationCode -> m RevocationCode
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> RevocationCode -> m RevocationCode
gmapQi :: Int -> (forall d. Data d => d -> u) -> RevocationCode -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> RevocationCode -> u
gmapQ :: (forall d. Data d => d -> u) -> RevocationCode -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> RevocationCode -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationCode -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationCode -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationCode -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> RevocationCode -> r
gmapT :: (forall b. Data b => b -> b) -> RevocationCode -> RevocationCode
$cgmapT :: (forall b. Data b => b -> b) -> RevocationCode -> RevocationCode
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RevocationCode)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c RevocationCode)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c RevocationCode)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c RevocationCode)
dataTypeOf :: RevocationCode -> DataType
$cdataTypeOf :: RevocationCode -> DataType
toConstr :: RevocationCode -> Constr
$ctoConstr :: RevocationCode -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RevocationCode
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c RevocationCode
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RevocationCode -> c RevocationCode
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> RevocationCode -> c RevocationCode
$cp1Data :: Typeable RevocationCode
Data, (forall x. RevocationCode -> Rep RevocationCode x)
-> (forall x. Rep RevocationCode x -> RevocationCode)
-> Generic RevocationCode
forall x. Rep RevocationCode x -> RevocationCode
forall x. RevocationCode -> Rep RevocationCode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RevocationCode x -> RevocationCode
$cfrom :: forall x. RevocationCode -> Rep RevocationCode x
Generic, Int -> RevocationCode -> ShowS
[RevocationCode] -> ShowS
RevocationCode -> String
(Int -> RevocationCode -> ShowS)
-> (RevocationCode -> String)
-> ([RevocationCode] -> ShowS)
-> Show RevocationCode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevocationCode] -> ShowS
$cshowList :: [RevocationCode] -> ShowS
show :: RevocationCode -> String
$cshow :: RevocationCode -> String
showsPrec :: Int -> RevocationCode -> ShowS
$cshowsPrec :: Int -> RevocationCode -> ShowS
Show, Typeable)

instance Eq RevocationCode where
  == :: RevocationCode -> RevocationCode -> Bool
(==) a :: RevocationCode
a b :: RevocationCode
b = RevocationCode -> Word8
forall a. FutureVal a => a -> Word8
fromFVal RevocationCode
a Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
== RevocationCode -> Word8
forall a. FutureVal a => a -> Word8
fromFVal RevocationCode
b

instance Ord RevocationCode where
  compare :: RevocationCode -> RevocationCode -> Ordering
compare = (RevocationCode -> Word8)
-> RevocationCode -> RevocationCode -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing RevocationCode -> Word8
forall a. FutureVal a => a -> Word8
fromFVal

instance FutureVal RevocationCode where
  fromFVal :: RevocationCode -> Word8
fromFVal NoReason = 0
  fromFVal KeySuperseded = 1
  fromFVal KeyMaterialCompromised = 2
  fromFVal KeyRetiredAndNoLongerUsed = 3
  fromFVal UserIdInfoNoLongerValid = 32
  fromFVal (RCoOther o :: Word8
o) = Word8
o
  toFVal :: Word8 -> RevocationCode
toFVal 0 = RevocationCode
NoReason
  toFVal 1 = RevocationCode
KeySuperseded
  toFVal 2 = RevocationCode
KeyMaterialCompromised
  toFVal 3 = RevocationCode
KeyRetiredAndNoLongerUsed
  toFVal 32 = RevocationCode
UserIdInfoNoLongerValid
  toFVal o :: Word8
o = Word8 -> RevocationCode
RCoOther Word8
o

instance Hashable RevocationCode

instance Pretty RevocationCode where
  pretty :: RevocationCode -> Doc ann
pretty NoReason = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "no reason"
  pretty KeySuperseded = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "key superseded"
  pretty KeyMaterialCompromised = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "key material compromised"
  pretty KeyRetiredAndNoLongerUsed = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "key retired and no longer used"
  pretty UserIdInfoNoLongerValid = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "user-ID info no longer valid"
  pretty (RCoOther o :: Word8
o) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown revocation code" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
o

$(ATH.deriveJSON ATH.defaultOptions ''RevocationCode)

data FeatureFlag
  = ModificationDetection
  | FeatureOther Int
  deriving (Typeable FeatureFlag
Constr
DataType
Typeable FeatureFlag =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> FeatureFlag -> c FeatureFlag)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c FeatureFlag)
-> (FeatureFlag -> Constr)
-> (FeatureFlag -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c FeatureFlag))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c FeatureFlag))
-> ((forall b. Data b => b -> b) -> FeatureFlag -> FeatureFlag)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> FeatureFlag -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> FeatureFlag -> r)
-> (forall u. (forall d. Data d => d -> u) -> FeatureFlag -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> FeatureFlag -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag)
-> Data FeatureFlag
FeatureFlag -> Constr
FeatureFlag -> DataType
(forall b. Data b => b -> b) -> FeatureFlag -> FeatureFlag
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FeatureFlag -> c FeatureFlag
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FeatureFlag
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) -> FeatureFlag -> u
forall u. (forall d. Data d => d -> u) -> FeatureFlag -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FeatureFlag -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FeatureFlag -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FeatureFlag
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FeatureFlag -> c FeatureFlag
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FeatureFlag)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c FeatureFlag)
$cFeatureOther :: Constr
$cModificationDetection :: Constr
$tFeatureFlag :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag
gmapMp :: (forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag
gmapM :: (forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> FeatureFlag -> m FeatureFlag
gmapQi :: Int -> (forall d. Data d => d -> u) -> FeatureFlag -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> FeatureFlag -> u
gmapQ :: (forall d. Data d => d -> u) -> FeatureFlag -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> FeatureFlag -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FeatureFlag -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FeatureFlag -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FeatureFlag -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FeatureFlag -> r
gmapT :: (forall b. Data b => b -> b) -> FeatureFlag -> FeatureFlag
$cgmapT :: (forall b. Data b => b -> b) -> FeatureFlag -> FeatureFlag
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c FeatureFlag)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c FeatureFlag)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c FeatureFlag)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c FeatureFlag)
dataTypeOf :: FeatureFlag -> DataType
$cdataTypeOf :: FeatureFlag -> DataType
toConstr :: FeatureFlag -> Constr
$ctoConstr :: FeatureFlag -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FeatureFlag
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c FeatureFlag
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FeatureFlag -> c FeatureFlag
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FeatureFlag -> c FeatureFlag
$cp1Data :: Typeable FeatureFlag
Data, (forall x. FeatureFlag -> Rep FeatureFlag x)
-> (forall x. Rep FeatureFlag x -> FeatureFlag)
-> Generic FeatureFlag
forall x. Rep FeatureFlag x -> FeatureFlag
forall x. FeatureFlag -> Rep FeatureFlag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FeatureFlag x -> FeatureFlag
$cfrom :: forall x. FeatureFlag -> Rep FeatureFlag x
Generic, Int -> FeatureFlag -> ShowS
[FeatureFlag] -> ShowS
FeatureFlag -> String
(Int -> FeatureFlag -> ShowS)
-> (FeatureFlag -> String)
-> ([FeatureFlag] -> ShowS)
-> Show FeatureFlag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FeatureFlag] -> ShowS
$cshowList :: [FeatureFlag] -> ShowS
show :: FeatureFlag -> String
$cshow :: FeatureFlag -> String
showsPrec :: Int -> FeatureFlag -> ShowS
$cshowsPrec :: Int -> FeatureFlag -> ShowS
Show, Typeable)

instance Eq FeatureFlag where
  == :: FeatureFlag -> FeatureFlag -> Bool
(==) a :: FeatureFlag
a b :: FeatureFlag
b = FeatureFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag FeatureFlag
a Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== FeatureFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag FeatureFlag
b

instance Ord FeatureFlag where
  compare :: FeatureFlag -> FeatureFlag -> Ordering
compare = (FeatureFlag -> Int) -> FeatureFlag -> FeatureFlag -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing FeatureFlag -> Int
forall a. FutureFlag a => a -> Int
fromFFlag

instance FutureFlag FeatureFlag where
  fromFFlag :: FeatureFlag -> Int
fromFFlag ModificationDetection = 7
  fromFFlag (FeatureOther i :: Int
i) = Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i
  toFFlag :: Int -> FeatureFlag
toFFlag 7 = FeatureFlag
ModificationDetection
  toFFlag i :: Int
i = Int -> FeatureFlag
FeatureOther (Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i)

instance Hashable FeatureFlag

instance Hashable a => Hashable (Set a) where
  hashWithSalt :: Int -> Set a -> Int
hashWithSalt salt :: Int
salt = Int -> [a] -> Int
forall a. Hashable a => Int -> a -> Int
hashWithSalt Int
salt ([a] -> Int) -> (Set a -> [a]) -> Set a -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Set a -> [a]
forall a. Set a -> [a]
Set.toList

instance Pretty FeatureFlag where
  pretty :: FeatureFlag -> Doc ann
pretty ModificationDetection = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "modification-detection"
  pretty (FeatureOther o :: Int
o) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown feature flag type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Int -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Int
o

$(ATH.deriveJSON ATH.defaultOptions ''FeatureFlag)

newtype URL =
  URL
    { URL -> URI
unURL :: URI
    }
  deriving (Typeable URL
Constr
DataType
Typeable URL =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> URL -> c URL)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c URL)
-> (URL -> Constr)
-> (URL -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c URL))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URL))
-> ((forall b. Data b => b -> b) -> URL -> URL)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r)
-> (forall u. (forall d. Data d => d -> u) -> URL -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> URL -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> URL -> m URL)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> URL -> m URL)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> URL -> m URL)
-> Data URL
URL -> Constr
URL -> DataType
(forall b. Data b => b -> b) -> URL -> URL
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> URL -> c URL
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c URL
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) -> URL -> u
forall u. (forall d. Data d => d -> u) -> URL -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> URL -> m URL
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> URL -> m URL
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c URL
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> URL -> c URL
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c URL)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URL)
$cURL :: Constr
$tURL :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> URL -> m URL
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> URL -> m URL
gmapMp :: (forall d. Data d => d -> m d) -> URL -> m URL
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> URL -> m URL
gmapM :: (forall d. Data d => d -> m d) -> URL -> m URL
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> URL -> m URL
gmapQi :: Int -> (forall d. Data d => d -> u) -> URL -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> URL -> u
gmapQ :: (forall d. Data d => d -> u) -> URL -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> URL -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URL -> r
gmapT :: (forall b. Data b => b -> b) -> URL -> URL
$cgmapT :: (forall b. Data b => b -> b) -> URL -> URL
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URL)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URL)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c URL)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c URL)
dataTypeOf :: URL -> DataType
$cdataTypeOf :: URL -> DataType
toConstr :: URL -> Constr
$ctoConstr :: URL -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c URL
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c URL
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> URL -> c URL
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> URL -> c URL
$cp1Data :: Typeable URL
Data, URL -> URL -> Bool
(URL -> URL -> Bool) -> (URL -> URL -> Bool) -> Eq URL
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: URL -> URL -> Bool
$c/= :: URL -> URL -> Bool
== :: URL -> URL -> Bool
$c== :: URL -> URL -> Bool
Eq, (forall x. URL -> Rep URL x)
-> (forall x. Rep URL x -> URL) -> Generic URL
forall x. Rep URL x -> URL
forall x. URL -> Rep URL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep URL x -> URL
$cfrom :: forall x. URL -> Rep URL x
Generic, Eq URL
Eq URL =>
(URL -> URL -> Ordering)
-> (URL -> URL -> Bool)
-> (URL -> URL -> Bool)
-> (URL -> URL -> Bool)
-> (URL -> URL -> Bool)
-> (URL -> URL -> URL)
-> (URL -> URL -> URL)
-> Ord URL
URL -> URL -> Bool
URL -> URL -> Ordering
URL -> URL -> URL
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
min :: URL -> URL -> URL
$cmin :: URL -> URL -> URL
max :: URL -> URL -> URL
$cmax :: URL -> URL -> URL
>= :: URL -> URL -> Bool
$c>= :: URL -> URL -> Bool
> :: URL -> URL -> Bool
$c> :: URL -> URL -> Bool
<= :: URL -> URL -> Bool
$c<= :: URL -> URL -> Bool
< :: URL -> URL -> Bool
$c< :: URL -> URL -> Bool
compare :: URL -> URL -> Ordering
$ccompare :: URL -> URL -> Ordering
$cp1Ord :: Eq URL
Ord, Int -> URL -> ShowS
[URL] -> ShowS
URL -> String
(Int -> URL -> ShowS)
-> (URL -> String) -> ([URL] -> ShowS) -> Show URL
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [URL] -> ShowS
$cshowList :: [URL] -> ShowS
show :: URL -> String
$cshow :: URL -> String
showsPrec :: Int -> URL -> ShowS
$cshowsPrec :: Int -> URL -> ShowS
Show, Typeable)

instance Newtype URL URI where
  pack :: URI -> URL
pack = URI -> URL
URL
  unpack :: URL -> URI
unpack (URL o :: URI
o) = URI
o

instance Hashable URL where
  hashWithSalt :: Int -> URL -> Int
hashWithSalt salt :: Int
salt (URL (URI s :: String
s a :: Maybe URIAuth
a p :: String
p q :: String
q f :: String
f)) =
    Int
salt Int -> String -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt` String
s Int -> String -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt` Maybe URIAuth -> String
forall a. Show a => a -> String
show Maybe URIAuth
a Int -> String -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt` String
p Int -> String -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt`
    String
q Int -> String -> Int
forall a. Hashable a => Int -> a -> Int
`hashWithSalt`
    String
f

instance Pretty URL where
  pretty :: URL -> Doc ann
pretty = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (String -> Doc ann) -> (URL -> String) -> URL -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (\uri :: URI
uri -> ShowS -> URI -> ShowS
uriToString ShowS
forall a. a -> a
id URI
uri "") (URI -> String) -> (URL -> URI) -> URL -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. URL -> URI
forall n o. Newtype n o => n -> o
unpack

instance A.ToJSON URL where
  toJSON :: URL -> Value
toJSON u :: URL
u = [Pair] -> Value
object [String -> Text
T.pack "uri" Text -> String -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (\uri :: URI
uri -> ShowS -> URI -> ShowS
uriToString ShowS
forall a. a -> a
id URI
uri "") (URL -> URI
forall n o. Newtype n o => n -> o
unpack URL
u)]

instance A.FromJSON URL where
  parseJSON :: Value -> Parser URL
parseJSON (A.Object v :: Object
v) =
    URI -> URL
URL (URI -> URL) -> (String -> URI) -> String -> URL
forall b c a. (b -> c) -> (a -> b) -> a -> c
. URI -> Maybe URI -> URI
forall a. a -> Maybe a -> a
fromMaybe URI
nullURI (Maybe URI -> URI) -> (String -> Maybe URI) -> String -> URI
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Maybe URI
parseURI (String -> URL) -> Parser String -> Parser URL
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser String
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "uri"
  parseJSON _ = Parser URL
forall (m :: * -> *) a. MonadPlus m => m a
mzero

data SigType
  = BinarySig
  | CanonicalTextSig
  | StandaloneSig
  | GenericCert
  | PersonaCert
  | CasualCert
  | PositiveCert
  | SubkeyBindingSig
  | PrimaryKeyBindingSig
  | SignatureDirectlyOnAKey
  | KeyRevocationSig
  | SubkeyRevocationSig
  | CertRevocationSig
  | TimestampSig
  | ThirdPartyConfirmationSig
  | OtherSig Word8
  deriving (Typeable SigType
Constr
DataType
Typeable SigType =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> SigType -> c SigType)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SigType)
-> (SigType -> Constr)
-> (SigType -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SigType))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SigType))
-> ((forall b. Data b => b -> b) -> SigType -> SigType)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SigType -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SigType -> r)
-> (forall u. (forall d. Data d => d -> u) -> SigType -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> SigType -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> SigType -> m SigType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SigType -> m SigType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SigType -> m SigType)
-> Data SigType
SigType -> Constr
SigType -> DataType
(forall b. Data b => b -> b) -> SigType -> SigType
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SigType -> c SigType
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigType
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) -> SigType -> u
forall u. (forall d. Data d => d -> u) -> SigType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SigType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SigType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SigType -> m SigType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SigType -> m SigType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SigType -> c SigType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SigType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SigType)
$cOtherSig :: Constr
$cThirdPartyConfirmationSig :: Constr
$cTimestampSig :: Constr
$cCertRevocationSig :: Constr
$cSubkeyRevocationSig :: Constr
$cKeyRevocationSig :: Constr
$cSignatureDirectlyOnAKey :: Constr
$cPrimaryKeyBindingSig :: Constr
$cSubkeyBindingSig :: Constr
$cPositiveCert :: Constr
$cCasualCert :: Constr
$cPersonaCert :: Constr
$cGenericCert :: Constr
$cStandaloneSig :: Constr
$cCanonicalTextSig :: Constr
$cBinarySig :: Constr
$tSigType :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> SigType -> m SigType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SigType -> m SigType
gmapMp :: (forall d. Data d => d -> m d) -> SigType -> m SigType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SigType -> m SigType
gmapM :: (forall d. Data d => d -> m d) -> SigType -> m SigType
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SigType -> m SigType
gmapQi :: Int -> (forall d. Data d => d -> u) -> SigType -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SigType -> u
gmapQ :: (forall d. Data d => d -> u) -> SigType -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SigType -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SigType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SigType -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SigType -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SigType -> r
gmapT :: (forall b. Data b => b -> b) -> SigType -> SigType
$cgmapT :: (forall b. Data b => b -> b) -> SigType -> SigType
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SigType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SigType)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c SigType)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SigType)
dataTypeOf :: SigType -> DataType
$cdataTypeOf :: SigType -> DataType
toConstr :: SigType -> Constr
$ctoConstr :: SigType -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigType
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SigType -> c SigType
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SigType -> c SigType
$cp1Data :: Typeable SigType
Data, (forall x. SigType -> Rep SigType x)
-> (forall x. Rep SigType x -> SigType) -> Generic SigType
forall x. Rep SigType x -> SigType
forall x. SigType -> Rep SigType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SigType x -> SigType
$cfrom :: forall x. SigType -> Rep SigType x
Generic, Int -> SigType -> ShowS
[SigType] -> ShowS
SigType -> String
(Int -> SigType -> ShowS)
-> (SigType -> String) -> ([SigType] -> ShowS) -> Show SigType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SigType] -> ShowS
$cshowList :: [SigType] -> ShowS
show :: SigType -> String
$cshow :: SigType -> String
showsPrec :: Int -> SigType -> ShowS
$cshowsPrec :: Int -> SigType -> ShowS
Show, Typeable)

instance Eq SigType where
  == :: SigType -> SigType -> Bool
(==) a :: SigType
a b :: SigType
b = SigType -> Word8
forall a. FutureVal a => a -> Word8
fromFVal SigType
a Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
== SigType -> Word8
forall a. FutureVal a => a -> Word8
fromFVal SigType
b

instance Ord SigType where
  compare :: SigType -> SigType -> Ordering
compare = (SigType -> Word8) -> SigType -> SigType -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing SigType -> Word8
forall a. FutureVal a => a -> Word8
fromFVal

instance FutureVal SigType where
  fromFVal :: SigType -> Word8
fromFVal BinarySig = 0x00
  fromFVal CanonicalTextSig = 0x01
  fromFVal StandaloneSig = 0x02
  fromFVal GenericCert = 0x10
  fromFVal PersonaCert = 0x11
  fromFVal CasualCert = 0x12
  fromFVal PositiveCert = 0x13
  fromFVal SubkeyBindingSig = 0x18
  fromFVal PrimaryKeyBindingSig = 0x19
  fromFVal SignatureDirectlyOnAKey = 0x1F
  fromFVal KeyRevocationSig = 0x20
  fromFVal SubkeyRevocationSig = 0x28
  fromFVal CertRevocationSig = 0x30
  fromFVal TimestampSig = 0x40
  fromFVal ThirdPartyConfirmationSig = 0x50
  fromFVal (OtherSig o :: Word8
o) = Word8
o
  toFVal :: Word8 -> SigType
toFVal 0x00 = SigType
BinarySig
  toFVal 0x01 = SigType
CanonicalTextSig
  toFVal 0x02 = SigType
StandaloneSig
  toFVal 0x10 = SigType
GenericCert
  toFVal 0x11 = SigType
PersonaCert
  toFVal 0x12 = SigType
CasualCert
  toFVal 0x13 = SigType
PositiveCert
  toFVal 0x18 = SigType
SubkeyBindingSig
  toFVal 0x19 = SigType
PrimaryKeyBindingSig
  toFVal 0x1F = SigType
SignatureDirectlyOnAKey
  toFVal 0x20 = SigType
KeyRevocationSig
  toFVal 0x28 = SigType
SubkeyRevocationSig
  toFVal 0x30 = SigType
CertRevocationSig
  toFVal 0x40 = SigType
TimestampSig
  toFVal 0x50 = SigType
ThirdPartyConfirmationSig
  toFVal o :: Word8
o = Word8 -> SigType
OtherSig Word8
o

instance Hashable SigType

instance Pretty SigType where
  pretty :: SigType -> Doc ann
pretty BinarySig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "binary"
  pretty CanonicalTextSig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "canonical-pretty"
  pretty StandaloneSig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "standalone"
  pretty GenericCert = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "generic"
  pretty PersonaCert = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "persona"
  pretty CasualCert = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "casual"
  pretty PositiveCert = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "positive"
  pretty SubkeyBindingSig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "subkey-binding"
  pretty PrimaryKeyBindingSig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "primary-key-binding"
  pretty SignatureDirectlyOnAKey = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "signature directly on a key"
  pretty KeyRevocationSig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "key-revocation"
  pretty SubkeyRevocationSig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "subkey-revocation"
  pretty CertRevocationSig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "cert-revocation"
  pretty TimestampSig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "timestamp"
  pretty ThirdPartyConfirmationSig = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "third-party-confirmation"
  pretty (OtherSig o :: Word8
o) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown signature type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
o

$(ATH.deriveJSON ATH.defaultOptions ''SigType)

newtype MPI =
  MPI
    { MPI -> Integer
unMPI :: Integer
    }
  deriving (Typeable MPI
Constr
DataType
Typeable MPI =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> MPI -> c MPI)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MPI)
-> (MPI -> Constr)
-> (MPI -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MPI))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MPI))
-> ((forall b. Data b => b -> b) -> MPI -> MPI)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MPI -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MPI -> r)
-> (forall u. (forall d. Data d => d -> u) -> MPI -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> MPI -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> MPI -> m MPI)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MPI -> m MPI)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MPI -> m MPI)
-> Data MPI
MPI -> Constr
MPI -> DataType
(forall b. Data b => b -> b) -> MPI -> MPI
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MPI -> c MPI
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MPI
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) -> MPI -> u
forall u. (forall d. Data d => d -> u) -> MPI -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MPI -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MPI -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MPI -> m MPI
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MPI -> m MPI
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MPI
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MPI -> c MPI
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MPI)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MPI)
$cMPI :: Constr
$tMPI :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> MPI -> m MPI
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MPI -> m MPI
gmapMp :: (forall d. Data d => d -> m d) -> MPI -> m MPI
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> MPI -> m MPI
gmapM :: (forall d. Data d => d -> m d) -> MPI -> m MPI
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> MPI -> m MPI
gmapQi :: Int -> (forall d. Data d => d -> u) -> MPI -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MPI -> u
gmapQ :: (forall d. Data d => d -> u) -> MPI -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> MPI -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MPI -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MPI -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MPI -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MPI -> r
gmapT :: (forall b. Data b => b -> b) -> MPI -> MPI
$cgmapT :: (forall b. Data b => b -> b) -> MPI -> MPI
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MPI)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c MPI)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c MPI)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c MPI)
dataTypeOf :: MPI -> DataType
$cdataTypeOf :: MPI -> DataType
toConstr :: MPI -> Constr
$ctoConstr :: MPI -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MPI
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c MPI
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MPI -> c MPI
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> MPI -> c MPI
$cp1Data :: Typeable MPI
Data, MPI -> MPI -> Bool
(MPI -> MPI -> Bool) -> (MPI -> MPI -> Bool) -> Eq MPI
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MPI -> MPI -> Bool
$c/= :: MPI -> MPI -> Bool
== :: MPI -> MPI -> Bool
$c== :: MPI -> MPI -> Bool
Eq, (forall x. MPI -> Rep MPI x)
-> (forall x. Rep MPI x -> MPI) -> Generic MPI
forall x. Rep MPI x -> MPI
forall x. MPI -> Rep MPI x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MPI x -> MPI
$cfrom :: forall x. MPI -> Rep MPI x
Generic, Int -> MPI -> ShowS
[MPI] -> ShowS
MPI -> String
(Int -> MPI -> ShowS)
-> (MPI -> String) -> ([MPI] -> ShowS) -> Show MPI
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MPI] -> ShowS
$cshowList :: [MPI] -> ShowS
show :: MPI -> String
$cshow :: MPI -> String
showsPrec :: Int -> MPI -> ShowS
$cshowsPrec :: Int -> MPI -> ShowS
Show, Typeable)

instance Newtype MPI Integer where
  pack :: Integer -> MPI
pack = Integer -> MPI
MPI
  unpack :: MPI -> Integer
unpack (MPI o :: Integer
o) = Integer
o

instance Hashable MPI

instance Pretty MPI where
  pretty :: MPI -> Doc ann
pretty = Integer -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (Integer -> Doc ann) -> (MPI -> Integer) -> MPI -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MPI -> Integer
forall n o. Newtype n o => n -> o
unpack

$(ATH.deriveJSON ATH.defaultOptions ''MPI)

data SignaturePayload
  = SigV3
      SigType
      ThirtyTwoBitTimeStamp
      EightOctetKeyId
      PubKeyAlgorithm
      HashAlgorithm
      Word16
      (NonEmpty MPI)
  | SigV4
      SigType
      PubKeyAlgorithm
      HashAlgorithm
      [SigSubPacket]
      [SigSubPacket]
      Word16
      (NonEmpty MPI)
  | SigVOther Word8 ByteString
  deriving (Typeable SignaturePayload
Constr
DataType
Typeable SignaturePayload =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> SignaturePayload -> c SignaturePayload)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SignaturePayload)
-> (SignaturePayload -> Constr)
-> (SignaturePayload -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SignaturePayload))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c SignaturePayload))
-> ((forall b. Data b => b -> b)
    -> SignaturePayload -> SignaturePayload)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SignaturePayload -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SignaturePayload -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> SignaturePayload -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SignaturePayload -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> SignaturePayload -> m SignaturePayload)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SignaturePayload -> m SignaturePayload)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SignaturePayload -> m SignaturePayload)
-> Data SignaturePayload
SignaturePayload -> Constr
SignaturePayload -> DataType
(forall b. Data b => b -> b)
-> SignaturePayload -> SignaturePayload
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SignaturePayload -> c SignaturePayload
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SignaturePayload
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) -> SignaturePayload -> u
forall u. (forall d. Data d => d -> u) -> SignaturePayload -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SignaturePayload -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SignaturePayload -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SignaturePayload -> m SignaturePayload
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignaturePayload -> m SignaturePayload
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SignaturePayload
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SignaturePayload -> c SignaturePayload
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SignaturePayload)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SignaturePayload)
$cSigVOther :: Constr
$cSigV4 :: Constr
$cSigV3 :: Constr
$tSignaturePayload :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> SignaturePayload -> m SignaturePayload
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignaturePayload -> m SignaturePayload
gmapMp :: (forall d. Data d => d -> m d)
-> SignaturePayload -> m SignaturePayload
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SignaturePayload -> m SignaturePayload
gmapM :: (forall d. Data d => d -> m d)
-> SignaturePayload -> m SignaturePayload
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SignaturePayload -> m SignaturePayload
gmapQi :: Int -> (forall d. Data d => d -> u) -> SignaturePayload -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SignaturePayload -> u
gmapQ :: (forall d. Data d => d -> u) -> SignaturePayload -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SignaturePayload -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SignaturePayload -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SignaturePayload -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SignaturePayload -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SignaturePayload -> r
gmapT :: (forall b. Data b => b -> b)
-> SignaturePayload -> SignaturePayload
$cgmapT :: (forall b. Data b => b -> b)
-> SignaturePayload -> SignaturePayload
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SignaturePayload)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SignaturePayload)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c SignaturePayload)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SignaturePayload)
dataTypeOf :: SignaturePayload -> DataType
$cdataTypeOf :: SignaturePayload -> DataType
toConstr :: SignaturePayload -> Constr
$ctoConstr :: SignaturePayload -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SignaturePayload
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SignaturePayload
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SignaturePayload -> c SignaturePayload
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SignaturePayload -> c SignaturePayload
$cp1Data :: Typeable SignaturePayload
Data, SignaturePayload -> SignaturePayload -> Bool
(SignaturePayload -> SignaturePayload -> Bool)
-> (SignaturePayload -> SignaturePayload -> Bool)
-> Eq SignaturePayload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignaturePayload -> SignaturePayload -> Bool
$c/= :: SignaturePayload -> SignaturePayload -> Bool
== :: SignaturePayload -> SignaturePayload -> Bool
$c== :: SignaturePayload -> SignaturePayload -> Bool
Eq, (forall x. SignaturePayload -> Rep SignaturePayload x)
-> (forall x. Rep SignaturePayload x -> SignaturePayload)
-> Generic SignaturePayload
forall x. Rep SignaturePayload x -> SignaturePayload
forall x. SignaturePayload -> Rep SignaturePayload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SignaturePayload x -> SignaturePayload
$cfrom :: forall x. SignaturePayload -> Rep SignaturePayload x
Generic, Int -> SignaturePayload -> ShowS
[SignaturePayload] -> ShowS
SignaturePayload -> String
(Int -> SignaturePayload -> ShowS)
-> (SignaturePayload -> String)
-> ([SignaturePayload] -> ShowS)
-> Show SignaturePayload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignaturePayload] -> ShowS
$cshowList :: [SignaturePayload] -> ShowS
show :: SignaturePayload -> String
$cshow :: SignaturePayload -> String
showsPrec :: Int -> SignaturePayload -> ShowS
$cshowsPrec :: Int -> SignaturePayload -> ShowS
Show, Typeable)

instance Hashable SignaturePayload

instance Pretty SignaturePayload where
  pretty :: SignaturePayload -> Doc ann
pretty (SigV3 st :: SigType
st ts :: ThirtyTwoBitTimeStamp
ts eoki :: EightOctetKeyId
eoki pka :: PubKeyAlgorithm
pka ha :: HashAlgorithm
ha w16 :: Word16
w16 mpis :: NonEmpty MPI
mpis) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "signature v3" Doc ann -> Doc ann -> Doc ann
forall a. Semigroup a => a -> a -> a
<> Char -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ':' Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    SigType -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty SigType
st Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    ThirtyTwoBitTimeStamp -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ThirtyTwoBitTimeStamp
ts Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    EightOctetKeyId -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty EightOctetKeyId
eoki Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    PubKeyAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty PubKeyAlgorithm
pka Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> HashAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty HashAlgorithm
ha Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word16 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word16
w16 Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ([MPI] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ([MPI] -> Doc ann)
-> (NonEmpty MPI -> [MPI]) -> NonEmpty MPI -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty MPI -> [MPI]
forall a. NonEmpty a -> [a]
NE.toList) NonEmpty MPI
mpis
  pretty (SigV4 st :: SigType
st pka :: PubKeyAlgorithm
pka ha :: HashAlgorithm
ha hsps :: [SigSubPacket]
hsps usps :: [SigSubPacket]
usps w16 :: Word16
w16 mpis :: NonEmpty MPI
mpis) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "signature v4" Doc ann -> Doc ann -> Doc ann
forall a. Semigroup a => a -> a -> a
<> Char -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ':' Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    SigType -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty SigType
st Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    PubKeyAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty PubKeyAlgorithm
pka Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    HashAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty HashAlgorithm
ha Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    [SigSubPacket] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty [SigSubPacket]
hsps Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [SigSubPacket] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty [SigSubPacket]
usps Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word16 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word16
w16 Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ([MPI] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ([MPI] -> Doc ann)
-> (NonEmpty MPI -> [MPI]) -> NonEmpty MPI -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty MPI -> [MPI]
forall a. NonEmpty a -> [a]
NE.toList) NonEmpty MPI
mpis
  pretty (SigVOther t :: Word8
t bs :: ByteString
bs) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown signature v" Doc ann -> Doc ann -> Doc ann
forall a. Semigroup a => a -> a -> a
<> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
t Doc ann -> Doc ann -> Doc ann
forall a. Semigroup a => a -> a -> a
<> Char -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ':' Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    [Word8] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (ByteString -> [Word8]
BL.unpack ByteString
bs)

instance A.ToJSON SignaturePayload where
  toJSON :: SignaturePayload -> Value
toJSON (SigV3 st :: SigType
st ts :: ThirtyTwoBitTimeStamp
ts eoki :: EightOctetKeyId
eoki pka :: PubKeyAlgorithm
pka ha :: HashAlgorithm
ha w16 :: Word16
w16 mpis :: NonEmpty MPI
mpis) =
    (SigType, ThirtyTwoBitTimeStamp, EightOctetKeyId, PubKeyAlgorithm,
 HashAlgorithm, Word16, [MPI])
-> Value
forall a. ToJSON a => a -> Value
A.toJSON (SigType
st, ThirtyTwoBitTimeStamp
ts, EightOctetKeyId
eoki, PubKeyAlgorithm
pka, HashAlgorithm
ha, Word16
w16, NonEmpty MPI -> [MPI]
forall a. NonEmpty a -> [a]
NE.toList NonEmpty MPI
mpis)
  toJSON (SigV4 st :: SigType
st pka :: PubKeyAlgorithm
pka ha :: HashAlgorithm
ha hsps :: [SigSubPacket]
hsps usps :: [SigSubPacket]
usps w16 :: Word16
w16 mpis :: NonEmpty MPI
mpis) =
    (SigType, PubKeyAlgorithm, HashAlgorithm, [SigSubPacket],
 [SigSubPacket], Word16, [MPI])
-> Value
forall a. ToJSON a => a -> Value
A.toJSON (SigType
st, PubKeyAlgorithm
pka, HashAlgorithm
ha, [SigSubPacket]
hsps, [SigSubPacket]
usps, Word16
w16, NonEmpty MPI -> [MPI]
forall a. NonEmpty a -> [a]
NE.toList NonEmpty MPI
mpis)
  toJSON (SigVOther t :: Word8
t bs :: ByteString
bs) = (Word8, [Word8]) -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Word8
t, ByteString -> [Word8]
BL.unpack ByteString
bs)

data SigSubPacketPayload
  = SigCreationTime ThirtyTwoBitTimeStamp
  | SigExpirationTime ThirtyTwoBitDuration
  | ExportableCertification Exportability
  | TrustSignature TrustLevel TrustAmount
  | RegularExpression AlmostPublicDomainRegex
  | Revocable Revocability
  | KeyExpirationTime ThirtyTwoBitDuration
  | PreferredSymmetricAlgorithms [SymmetricAlgorithm]
  | RevocationKey (Set RevocationClass) PubKeyAlgorithm TwentyOctetFingerprint
  | Issuer EightOctetKeyId
  | NotationData (Set NotationFlag) NotationName NotationValue
  | PreferredHashAlgorithms [HashAlgorithm]
  | PreferredCompressionAlgorithms [CompressionAlgorithm]
  | KeyServerPreferences (Set KSPFlag)
  | PreferredKeyServer KeyServer
  | PrimaryUserId Bool
  | PolicyURL URL
  | KeyFlags (Set KeyFlag)
  | SignersUserId Text
  | ReasonForRevocation RevocationCode RevocationReason
  | Features (Set FeatureFlag)
  | SignatureTarget PubKeyAlgorithm HashAlgorithm SignatureHash
  | EmbeddedSignature SignaturePayload
  | IssuerFingerprint Word8 TwentyOctetFingerprint
  | UserDefinedSigSub Word8 ByteString
  | OtherSigSub Word8 ByteString
  deriving (Typeable SigSubPacketPayload
Constr
DataType
Typeable SigSubPacketPayload =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> SigSubPacketPayload
 -> c SigSubPacketPayload)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SigSubPacketPayload)
-> (SigSubPacketPayload -> Constr)
-> (SigSubPacketPayload -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SigSubPacketPayload))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c SigSubPacketPayload))
-> ((forall b. Data b => b -> b)
    -> SigSubPacketPayload -> SigSubPacketPayload)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SigSubPacketPayload -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SigSubPacketPayload -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> SigSubPacketPayload -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SigSubPacketPayload -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> SigSubPacketPayload -> m SigSubPacketPayload)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SigSubPacketPayload -> m SigSubPacketPayload)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> SigSubPacketPayload -> m SigSubPacketPayload)
-> Data SigSubPacketPayload
SigSubPacketPayload -> Constr
SigSubPacketPayload -> DataType
(forall b. Data b => b -> b)
-> SigSubPacketPayload -> SigSubPacketPayload
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SigSubPacketPayload
-> c SigSubPacketPayload
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigSubPacketPayload
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) -> SigSubPacketPayload -> u
forall u.
(forall d. Data d => d -> u) -> SigSubPacketPayload -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacketPayload -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacketPayload -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SigSubPacketPayload -> m SigSubPacketPayload
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SigSubPacketPayload -> m SigSubPacketPayload
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigSubPacketPayload
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SigSubPacketPayload
-> c SigSubPacketPayload
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SigSubPacketPayload)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SigSubPacketPayload)
$cOtherSigSub :: Constr
$cUserDefinedSigSub :: Constr
$cIssuerFingerprint :: Constr
$cEmbeddedSignature :: Constr
$cSignatureTarget :: Constr
$cFeatures :: Constr
$cReasonForRevocation :: Constr
$cSignersUserId :: Constr
$cKeyFlags :: Constr
$cPolicyURL :: Constr
$cPrimaryUserId :: Constr
$cPreferredKeyServer :: Constr
$cKeyServerPreferences :: Constr
$cPreferredCompressionAlgorithms :: Constr
$cPreferredHashAlgorithms :: Constr
$cNotationData :: Constr
$cIssuer :: Constr
$cRevocationKey :: Constr
$cPreferredSymmetricAlgorithms :: Constr
$cKeyExpirationTime :: Constr
$cRevocable :: Constr
$cRegularExpression :: Constr
$cTrustSignature :: Constr
$cExportableCertification :: Constr
$cSigExpirationTime :: Constr
$cSigCreationTime :: Constr
$tSigSubPacketPayload :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> SigSubPacketPayload -> m SigSubPacketPayload
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SigSubPacketPayload -> m SigSubPacketPayload
gmapMp :: (forall d. Data d => d -> m d)
-> SigSubPacketPayload -> m SigSubPacketPayload
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> SigSubPacketPayload -> m SigSubPacketPayload
gmapM :: (forall d. Data d => d -> m d)
-> SigSubPacketPayload -> m SigSubPacketPayload
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> SigSubPacketPayload -> m SigSubPacketPayload
gmapQi :: Int -> (forall d. Data d => d -> u) -> SigSubPacketPayload -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> SigSubPacketPayload -> u
gmapQ :: (forall d. Data d => d -> u) -> SigSubPacketPayload -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> SigSubPacketPayload -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacketPayload -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacketPayload -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacketPayload -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacketPayload -> r
gmapT :: (forall b. Data b => b -> b)
-> SigSubPacketPayload -> SigSubPacketPayload
$cgmapT :: (forall b. Data b => b -> b)
-> SigSubPacketPayload -> SigSubPacketPayload
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SigSubPacketPayload)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SigSubPacketPayload)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c SigSubPacketPayload)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SigSubPacketPayload)
dataTypeOf :: SigSubPacketPayload -> DataType
$cdataTypeOf :: SigSubPacketPayload -> DataType
toConstr :: SigSubPacketPayload -> Constr
$ctoConstr :: SigSubPacketPayload -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigSubPacketPayload
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigSubPacketPayload
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SigSubPacketPayload
-> c SigSubPacketPayload
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> SigSubPacketPayload
-> c SigSubPacketPayload
$cp1Data :: Typeable SigSubPacketPayload
Data, SigSubPacketPayload -> SigSubPacketPayload -> Bool
(SigSubPacketPayload -> SigSubPacketPayload -> Bool)
-> (SigSubPacketPayload -> SigSubPacketPayload -> Bool)
-> Eq SigSubPacketPayload
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SigSubPacketPayload -> SigSubPacketPayload -> Bool
$c/= :: SigSubPacketPayload -> SigSubPacketPayload -> Bool
== :: SigSubPacketPayload -> SigSubPacketPayload -> Bool
$c== :: SigSubPacketPayload -> SigSubPacketPayload -> Bool
Eq, (forall x. SigSubPacketPayload -> Rep SigSubPacketPayload x)
-> (forall x. Rep SigSubPacketPayload x -> SigSubPacketPayload)
-> Generic SigSubPacketPayload
forall x. Rep SigSubPacketPayload x -> SigSubPacketPayload
forall x. SigSubPacketPayload -> Rep SigSubPacketPayload x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SigSubPacketPayload x -> SigSubPacketPayload
$cfrom :: forall x. SigSubPacketPayload -> Rep SigSubPacketPayload x
Generic, Int -> SigSubPacketPayload -> ShowS
[SigSubPacketPayload] -> ShowS
SigSubPacketPayload -> String
(Int -> SigSubPacketPayload -> ShowS)
-> (SigSubPacketPayload -> String)
-> ([SigSubPacketPayload] -> ShowS)
-> Show SigSubPacketPayload
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SigSubPacketPayload] -> ShowS
$cshowList :: [SigSubPacketPayload] -> ShowS
show :: SigSubPacketPayload -> String
$cshow :: SigSubPacketPayload -> String
showsPrec :: Int -> SigSubPacketPayload -> ShowS
$cshowsPrec :: Int -> SigSubPacketPayload -> ShowS
Show, Typeable) -- FIXME

instance Hashable SigSubPacketPayload

instance Pretty SigSubPacketPayload where
  pretty :: SigSubPacketPayload -> Doc ann
pretty (SigCreationTime ts :: ThirtyTwoBitTimeStamp
ts) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "creation-time" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ThirtyTwoBitTimeStamp -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ThirtyTwoBitTimeStamp
ts
  pretty (SigExpirationTime d :: ThirtyTwoBitDuration
d) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "sig expiration time" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ThirtyTwoBitDuration -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ThirtyTwoBitDuration
d
  pretty (ExportableCertification e :: Bool
e) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "exportable certification" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Bool -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Bool
e
  pretty (TrustSignature tl :: Word8
tl ta :: Word8
ta) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "trust signature" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
tl Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
ta
  pretty (RegularExpression apdre :: ByteString
apdre) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "regular expression" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ByteString -> Doc ann
forall ann. ByteString -> Doc ann
prettyLBS ByteString
apdre
  pretty (Revocable r :: Bool
r) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "revocable" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Bool -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Bool
r
  pretty (KeyExpirationTime d :: ThirtyTwoBitDuration
d) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "key expiration time" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ThirtyTwoBitDuration -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ThirtyTwoBitDuration
d
  pretty (PreferredSymmetricAlgorithms sas :: [SymmetricAlgorithm]
sas) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "preferred symmetric algorithms" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [SymmetricAlgorithm] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty [SymmetricAlgorithm]
sas
  pretty (RevocationKey rcs :: Set RevocationClass
rcs pka :: PubKeyAlgorithm
pka tof :: TwentyOctetFingerprint
tof) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "revocation key" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    [RevocationClass] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (Set RevocationClass -> [RevocationClass]
forall a. Set a -> [a]
Set.toList Set RevocationClass
rcs) Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> PubKeyAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty PubKeyAlgorithm
pka Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> TwentyOctetFingerprint -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty TwentyOctetFingerprint
tof
  pretty (Issuer eoki :: EightOctetKeyId
eoki) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "issuer" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> EightOctetKeyId -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty EightOctetKeyId
eoki
  pretty (NotationData nfs :: Set NotationFlag
nfs nn :: NotationName
nn nv :: NotationValue
nv) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "notation data" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    [NotationFlag] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (Set NotationFlag -> [NotationFlag]
forall a. Set a -> [a]
Set.toList Set NotationFlag
nfs) Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> NotationName -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty NotationName
nn Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> NotationValue -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty NotationValue
nv
  pretty (PreferredHashAlgorithms phas :: [HashAlgorithm]
phas) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "preferred hash algorithms" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [HashAlgorithm] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty [HashAlgorithm]
phas
  pretty (PreferredCompressionAlgorithms pcas :: [CompressionAlgorithm]
pcas) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "preferred compression algorithms" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [CompressionAlgorithm] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty [CompressionAlgorithm]
pcas
  pretty (KeyServerPreferences kspfs :: Set KSPFlag
kspfs) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "keyserver preferences" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [KSPFlag] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (Set KSPFlag -> [KSPFlag]
forall a. Set a -> [a]
Set.toList Set KSPFlag
kspfs)
  pretty (PreferredKeyServer ks :: ByteString
ks) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "preferred keyserver" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ByteString -> Doc ann
forall ann. ByteString -> Doc ann
prettyLBS ByteString
ks
  pretty (PrimaryUserId p :: Bool
p) =
    (if Bool
p
       then Doc ann
forall a. Monoid a => a
mempty
       else String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "NOT ") Doc ann -> Doc ann -> Doc ann
forall a. Semigroup a => a -> a -> a
<>
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "primary user-ID"
  pretty (PolicyURL u :: URL
u) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "policy URL" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> URL -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty URL
u
  pretty (KeyFlags kfs :: Set KeyFlag
kfs) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "key flags" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [KeyFlag] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (Set KeyFlag -> [KeyFlag]
forall a. Set a -> [a]
Set.toList Set KeyFlag
kfs)
  pretty (SignersUserId u :: Text
u) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "signer's user-ID" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Text -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Text
u
  pretty (ReasonForRevocation rc :: RevocationCode
rc rr :: Text
rr) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "reason for revocation" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> RevocationCode -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty RevocationCode
rc Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Text -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Text
rr
  pretty (Features ffs :: Set FeatureFlag
ffs) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "features" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [FeatureFlag] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (Set FeatureFlag -> [FeatureFlag]
forall a. Set a -> [a]
Set.toList Set FeatureFlag
ffs)
  pretty (SignatureTarget pka :: PubKeyAlgorithm
pka ha :: HashAlgorithm
ha sh :: ByteString
sh) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "signature target" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> PubKeyAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty PubKeyAlgorithm
pka Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> HashAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty HashAlgorithm
ha Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ByteString -> Doc ann
forall ann. ByteString -> Doc ann
prettyLBS ByteString
sh
  pretty (EmbeddedSignature sp :: SignaturePayload
sp) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "embedded signature" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> SignaturePayload -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty SignaturePayload
sp
  pretty (IssuerFingerprint kv :: Word8
kv ifp :: TwentyOctetFingerprint
ifp) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "issuer fingerprint (v" Doc ann -> Doc ann -> Doc ann
forall a. Semigroup a => a -> a -> a
<> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
kv Doc ann -> Doc ann -> Doc ann
forall a. Semigroup a => a -> a -> a
<> String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ")" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> TwentyOctetFingerprint -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty TwentyOctetFingerprint
ifp
  pretty (UserDefinedSigSub t :: Word8
t bs :: ByteString
bs) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "user-defined signature subpacket type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
t Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [Word8] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (ByteString -> [Word8]
BL.unpack ByteString
bs)
  pretty (OtherSigSub t :: Word8
t bs :: ByteString
bs) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown signature subpacket type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
t Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ByteString -> Doc ann
forall ann. ByteString -> Doc ann
prettyLBS ByteString
bs

instance A.ToJSON SigSubPacketPayload where
  toJSON :: SigSubPacketPayload -> Value
toJSON (SigCreationTime ts :: ThirtyTwoBitTimeStamp
ts) = [Pair] -> Value
object [String -> Text
T.pack "sigCreationTime" Text -> ThirtyTwoBitTimeStamp -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= ThirtyTwoBitTimeStamp
ts]
  toJSON (SigExpirationTime d :: ThirtyTwoBitDuration
d) = [Pair] -> Value
object [String -> Text
T.pack "sigExpirationTime" Text -> ThirtyTwoBitDuration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= ThirtyTwoBitDuration
d]
  toJSON (ExportableCertification e :: Bool
e) =
    [Pair] -> Value
object [String -> Text
T.pack "exportableCertification" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Bool
e]
  toJSON (TrustSignature tl :: Word8
tl ta :: Word8
ta) = [Pair] -> Value
object [String -> Text
T.pack "trustSignature" Text -> (Word8, Word8) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (Word8
tl, Word8
ta)]
  toJSON (RegularExpression apdre :: ByteString
apdre) =
    [Pair] -> Value
object [String -> Text
T.pack "regularExpression" Text -> [Word8] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= ByteString -> [Word8]
BL.unpack ByteString
apdre]
  toJSON (Revocable r :: Bool
r) = [Pair] -> Value
object [String -> Text
T.pack "revocable" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Bool
r]
  toJSON (KeyExpirationTime d :: ThirtyTwoBitDuration
d) = [Pair] -> Value
object [String -> Text
T.pack "keyExpirationTime" Text -> ThirtyTwoBitDuration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= ThirtyTwoBitDuration
d]
  toJSON (PreferredSymmetricAlgorithms sas :: [SymmetricAlgorithm]
sas) =
    [Pair] -> Value
object [String -> Text
T.pack "preferredSymmetricAlgorithms" Text -> [SymmetricAlgorithm] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= [SymmetricAlgorithm]
sas]
  toJSON (RevocationKey rcs :: Set RevocationClass
rcs pka :: PubKeyAlgorithm
pka tof :: TwentyOctetFingerprint
tof) =
    [Pair] -> Value
object [String -> Text
T.pack "revocationKey" Text
-> (Set RevocationClass, PubKeyAlgorithm, TwentyOctetFingerprint)
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (Set RevocationClass
rcs, PubKeyAlgorithm
pka, TwentyOctetFingerprint
tof)]
  toJSON (Issuer eoki :: EightOctetKeyId
eoki) = [Pair] -> Value
object [String -> Text
T.pack "issuer" Text -> EightOctetKeyId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= EightOctetKeyId
eoki]
  toJSON (NotationData nfs :: Set NotationFlag
nfs (NotationName nn :: ByteString
nn) (NotationValue nv :: ByteString
nv)) =
    [Pair] -> Value
object [String -> Text
T.pack "notationData" Text -> (Set NotationFlag, [Word8], [Word8]) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (Set NotationFlag
nfs, ByteString -> [Word8]
BL.unpack ByteString
nn, ByteString -> [Word8]
BL.unpack ByteString
nv)]
  toJSON (PreferredHashAlgorithms phas :: [HashAlgorithm]
phas) =
    [Pair] -> Value
object [String -> Text
T.pack "preferredHashAlgorithms" Text -> [HashAlgorithm] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= [HashAlgorithm]
phas]
  toJSON (PreferredCompressionAlgorithms pcas :: [CompressionAlgorithm]
pcas) =
    [Pair] -> Value
object [String -> Text
T.pack "preferredCompressionAlgorithms" Text -> [CompressionAlgorithm] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= [CompressionAlgorithm]
pcas]
  toJSON (KeyServerPreferences kspfs :: Set KSPFlag
kspfs) =
    [Pair] -> Value
object [String -> Text
T.pack "keyServerPreferences" Text -> Set KSPFlag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Set KSPFlag
kspfs]
  toJSON (PreferredKeyServer ks :: ByteString
ks) =
    [Pair] -> Value
object [String -> Text
T.pack "preferredKeyServer" Text -> String -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= ByteString -> String
forall a. Show a => a -> String
show ByteString
ks]
  toJSON (PrimaryUserId p :: Bool
p) = [Pair] -> Value
object [String -> Text
T.pack "primaryUserId" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Bool
p]
  toJSON (PolicyURL u :: URL
u) = [Pair] -> Value
object [String -> Text
T.pack "policyURL" Text -> URL -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= URL
u]
  toJSON (KeyFlags kfs :: Set KeyFlag
kfs) = [Pair] -> Value
object [String -> Text
T.pack "keyFlags" Text -> Set KeyFlag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Set KeyFlag
kfs]
  toJSON (SignersUserId u :: Text
u) = [Pair] -> Value
object [String -> Text
T.pack "signersUserId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Text
u]
  toJSON (ReasonForRevocation rc :: RevocationCode
rc rr :: Text
rr) =
    [Pair] -> Value
object [String -> Text
T.pack "reasonForRevocation" Text -> (RevocationCode, Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (RevocationCode
rc, Text
rr)]
  toJSON (Features ffs :: Set FeatureFlag
ffs) = [Pair] -> Value
object [String -> Text
T.pack "features" Text -> Set FeatureFlag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= Set FeatureFlag
ffs]
  toJSON (SignatureTarget pka :: PubKeyAlgorithm
pka ha :: HashAlgorithm
ha sh :: ByteString
sh) =
    [Pair] -> Value
object [String -> Text
T.pack "signatureTarget" Text -> (PubKeyAlgorithm, HashAlgorithm, [Word8]) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (PubKeyAlgorithm
pka, HashAlgorithm
ha, ByteString -> [Word8]
BL.unpack ByteString
sh)]
  toJSON (EmbeddedSignature sp :: SignaturePayload
sp) = [Pair] -> Value
object [String -> Text
T.pack "embeddedSignature" Text -> SignaturePayload -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= SignaturePayload
sp]
  toJSON (IssuerFingerprint kv :: Word8
kv ifp :: TwentyOctetFingerprint
ifp) =
    [Pair] -> Value
object [String -> Text
T.pack "issuerFingerprint" Text -> (Word8, TwentyOctetFingerprint) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (Word8
kv, TwentyOctetFingerprint
ifp)]
  toJSON (UserDefinedSigSub t :: Word8
t bs :: ByteString
bs) =
    [Pair] -> Value
object [String -> Text
T.pack "userDefinedSigSub" Text -> (Word8, [Word8]) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (Word8
t, ByteString -> [Word8]
BL.unpack ByteString
bs)]
  toJSON (OtherSigSub t :: Word8
t bs :: ByteString
bs) = [Pair] -> Value
object [String -> Text
T.pack "otherSigSub" Text -> (Word8, [Word8]) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
.= (Word8
t, ByteString -> [Word8]
BL.unpack ByteString
bs)]

uc3 :: (a -> b -> c -> d) -> (a, b, c) -> d
uc3 :: (a -> b -> c -> d) -> (a, b, c) -> d
uc3 f :: a -> b -> c -> d
f ~(a :: a
a, b :: b
b, c :: c
c) = a -> b -> c -> d
f a
a b
b c
c

instance A.FromJSON SigSubPacketPayload where
  parseJSON :: Value -> Parser SigSubPacketPayload
parseJSON (A.Object v :: Object
v) =
    (ThirtyTwoBitTimeStamp -> SigSubPacketPayload
SigCreationTime (ThirtyTwoBitTimeStamp -> SigSubPacketPayload)
-> Parser ThirtyTwoBitTimeStamp -> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser ThirtyTwoBitTimeStamp
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "sigCreationTime") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    (ThirtyTwoBitDuration -> SigSubPacketPayload
SigExpirationTime (ThirtyTwoBitDuration -> SigSubPacketPayload)
-> Parser ThirtyTwoBitDuration -> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser ThirtyTwoBitDuration
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "sigExpirationTime") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    (Bool -> SigSubPacketPayload
ExportableCertification (Bool -> SigSubPacketPayload)
-> Parser Bool -> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "exportableCertification") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    ((Word8 -> Word8 -> SigSubPacketPayload)
-> (Word8, Word8) -> SigSubPacketPayload
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Word8 -> Word8 -> SigSubPacketPayload
TrustSignature ((Word8, Word8) -> SigSubPacketPayload)
-> Parser (Word8, Word8) -> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser (Word8, Word8)
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "trustSignature") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    (ByteString -> SigSubPacketPayload
RegularExpression (ByteString -> SigSubPacketPayload)
-> ([Word8] -> ByteString) -> [Word8] -> SigSubPacketPayload
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Word8] -> ByteString
BL.pack ([Word8] -> SigSubPacketPayload)
-> Parser [Word8] -> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser [Word8]
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "regularExpression") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    (Bool -> SigSubPacketPayload
Revocable (Bool -> SigSubPacketPayload)
-> Parser Bool -> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "revocable") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    (ThirtyTwoBitDuration -> SigSubPacketPayload
KeyExpirationTime (ThirtyTwoBitDuration -> SigSubPacketPayload)
-> Parser ThirtyTwoBitDuration -> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser ThirtyTwoBitDuration
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "keyExpirationTime") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    ([SymmetricAlgorithm] -> SigSubPacketPayload
PreferredSymmetricAlgorithms ([SymmetricAlgorithm] -> SigSubPacketPayload)
-> Parser [SymmetricAlgorithm] -> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$>
     Object
v Object -> Text -> Parser [SymmetricAlgorithm]
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "preferredSymmetricAlgorithms") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    ((Set RevocationClass
 -> PubKeyAlgorithm
 -> TwentyOctetFingerprint
 -> SigSubPacketPayload)
-> (Set RevocationClass, PubKeyAlgorithm, TwentyOctetFingerprint)
-> SigSubPacketPayload
forall a b c d. (a -> b -> c -> d) -> (a, b, c) -> d
uc3 Set RevocationClass
-> PubKeyAlgorithm -> TwentyOctetFingerprint -> SigSubPacketPayload
RevocationKey ((Set RevocationClass, PubKeyAlgorithm, TwentyOctetFingerprint)
 -> SigSubPacketPayload)
-> Parser
     (Set RevocationClass, PubKeyAlgorithm, TwentyOctetFingerprint)
-> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object
-> Text
-> Parser
     (Set RevocationClass, PubKeyAlgorithm, TwentyOctetFingerprint)
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "revocationKey") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    (EightOctetKeyId -> SigSubPacketPayload
Issuer (EightOctetKeyId -> SigSubPacketPayload)
-> Parser EightOctetKeyId -> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object -> Text -> Parser EightOctetKeyId
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "issuer") Parser SigSubPacketPayload
-> Parser SigSubPacketPayload -> Parser SigSubPacketPayload
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|>
    ((Set NotationFlag
 -> NotationName -> NotationValue -> SigSubPacketPayload)
-> (Set NotationFlag, NotationName, NotationValue)
-> SigSubPacketPayload
forall a b c d. (a -> b -> c -> d) -> (a, b, c) -> d
uc3 Set NotationFlag
-> NotationName -> NotationValue -> SigSubPacketPayload
NotationData ((Set NotationFlag, NotationName, NotationValue)
 -> SigSubPacketPayload)
-> Parser (Set NotationFlag, NotationName, NotationValue)
-> Parser SigSubPacketPayload
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
v Object
-> Text -> Parser (Set NotationFlag, NotationName, NotationValue)
forall a. FromJSON a => Object -> Text -> Parser a
A..: String -> Text
T.pack "notationData")
  parseJSON _ = Parser SigSubPacketPayload
forall (m :: * -> *) a. MonadPlus m => m a
mzero

data SigSubPacket =
  SigSubPacket
    { SigSubPacket -> Bool
_sspCriticality :: Bool
    , SigSubPacket -> SigSubPacketPayload
_sspPayload :: SigSubPacketPayload
    }
  deriving (Typeable SigSubPacket
Constr
DataType
Typeable SigSubPacket =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> SigSubPacket -> c SigSubPacket)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c SigSubPacket)
-> (SigSubPacket -> Constr)
-> (SigSubPacket -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c SigSubPacket))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c SigSubPacket))
-> ((forall b. Data b => b -> b) -> SigSubPacket -> SigSubPacket)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> SigSubPacket -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> SigSubPacket -> r)
-> (forall u. (forall d. Data d => d -> u) -> SigSubPacket -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> SigSubPacket -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket)
-> Data SigSubPacket
SigSubPacket -> Constr
SigSubPacket -> DataType
(forall b. Data b => b -> b) -> SigSubPacket -> SigSubPacket
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SigSubPacket -> c SigSubPacket
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigSubPacket
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) -> SigSubPacket -> u
forall u. (forall d. Data d => d -> u) -> SigSubPacket -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacket -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacket -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigSubPacket
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SigSubPacket -> c SigSubPacket
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SigSubPacket)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SigSubPacket)
$cSigSubPacket :: Constr
$tSigSubPacket :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket
gmapMp :: (forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket
gmapM :: (forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> SigSubPacket -> m SigSubPacket
gmapQi :: Int -> (forall d. Data d => d -> u) -> SigSubPacket -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> SigSubPacket -> u
gmapQ :: (forall d. Data d => d -> u) -> SigSubPacket -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> SigSubPacket -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacket -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacket -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacket -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> SigSubPacket -> r
gmapT :: (forall b. Data b => b -> b) -> SigSubPacket -> SigSubPacket
$cgmapT :: (forall b. Data b => b -> b) -> SigSubPacket -> SigSubPacket
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SigSubPacket)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c SigSubPacket)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c SigSubPacket)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c SigSubPacket)
dataTypeOf :: SigSubPacket -> DataType
$cdataTypeOf :: SigSubPacket -> DataType
toConstr :: SigSubPacket -> Constr
$ctoConstr :: SigSubPacket -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigSubPacket
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c SigSubPacket
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SigSubPacket -> c SigSubPacket
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> SigSubPacket -> c SigSubPacket
$cp1Data :: Typeable SigSubPacket
Data, SigSubPacket -> SigSubPacket -> Bool
(SigSubPacket -> SigSubPacket -> Bool)
-> (SigSubPacket -> SigSubPacket -> Bool) -> Eq SigSubPacket
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SigSubPacket -> SigSubPacket -> Bool
$c/= :: SigSubPacket -> SigSubPacket -> Bool
== :: SigSubPacket -> SigSubPacket -> Bool
$c== :: SigSubPacket -> SigSubPacket -> Bool
Eq, (forall x. SigSubPacket -> Rep SigSubPacket x)
-> (forall x. Rep SigSubPacket x -> SigSubPacket)
-> Generic SigSubPacket
forall x. Rep SigSubPacket x -> SigSubPacket
forall x. SigSubPacket -> Rep SigSubPacket x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SigSubPacket x -> SigSubPacket
$cfrom :: forall x. SigSubPacket -> Rep SigSubPacket x
Generic, Int -> SigSubPacket -> ShowS
[SigSubPacket] -> ShowS
SigSubPacket -> String
(Int -> SigSubPacket -> ShowS)
-> (SigSubPacket -> String)
-> ([SigSubPacket] -> ShowS)
-> Show SigSubPacket
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SigSubPacket] -> ShowS
$cshowList :: [SigSubPacket] -> ShowS
show :: SigSubPacket -> String
$cshow :: SigSubPacket -> String
showsPrec :: Int -> SigSubPacket -> ShowS
$cshowsPrec :: Int -> SigSubPacket -> ShowS
Show, Typeable)

instance Pretty SigSubPacket where
  pretty :: SigSubPacket -> Doc ann
pretty x :: SigSubPacket
x =
    (if SigSubPacket -> Bool
_sspCriticality SigSubPacket
x
       then Char -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty '*'
       else Doc ann
forall a. Monoid a => a
mempty) Doc ann -> Doc ann -> Doc ann
forall a. Semigroup a => a -> a -> a
<>
    (SigSubPacketPayload -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (SigSubPacketPayload -> Doc ann)
-> (SigSubPacket -> SigSubPacketPayload) -> SigSubPacket -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SigSubPacket -> SigSubPacketPayload
_sspPayload) SigSubPacket
x

instance Hashable SigSubPacket

$(ATH.deriveJSON ATH.defaultOptions ''SigSubPacket)

$(makeLenses ''SigSubPacket)

data KeyVersion
  = DeprecatedV3
  | V4
  deriving (Typeable KeyVersion
Constr
DataType
Typeable KeyVersion =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> KeyVersion -> c KeyVersion)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c KeyVersion)
-> (KeyVersion -> Constr)
-> (KeyVersion -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c KeyVersion))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c KeyVersion))
-> ((forall b. Data b => b -> b) -> KeyVersion -> KeyVersion)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> KeyVersion -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> KeyVersion -> r)
-> (forall u. (forall d. Data d => d -> u) -> KeyVersion -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> KeyVersion -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion)
-> Data KeyVersion
KeyVersion -> Constr
KeyVersion -> DataType
(forall b. Data b => b -> b) -> KeyVersion -> KeyVersion
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KeyVersion -> c KeyVersion
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KeyVersion
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) -> KeyVersion -> u
forall u. (forall d. Data d => d -> u) -> KeyVersion -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KeyVersion -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KeyVersion -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KeyVersion
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KeyVersion -> c KeyVersion
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KeyVersion)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyVersion)
$cV4 :: Constr
$cDeprecatedV3 :: Constr
$tKeyVersion :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion
gmapMp :: (forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion
gmapM :: (forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> KeyVersion -> m KeyVersion
gmapQi :: Int -> (forall d. Data d => d -> u) -> KeyVersion -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> KeyVersion -> u
gmapQ :: (forall d. Data d => d -> u) -> KeyVersion -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> KeyVersion -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KeyVersion -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> KeyVersion -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KeyVersion -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> KeyVersion -> r
gmapT :: (forall b. Data b => b -> b) -> KeyVersion -> KeyVersion
$cgmapT :: (forall b. Data b => b -> b) -> KeyVersion -> KeyVersion
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyVersion)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KeyVersion)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c KeyVersion)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c KeyVersion)
dataTypeOf :: KeyVersion -> DataType
$cdataTypeOf :: KeyVersion -> DataType
toConstr :: KeyVersion -> Constr
$ctoConstr :: KeyVersion -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KeyVersion
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c KeyVersion
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KeyVersion -> c KeyVersion
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> KeyVersion -> c KeyVersion
$cp1Data :: Typeable KeyVersion
Data, KeyVersion -> KeyVersion -> Bool
(KeyVersion -> KeyVersion -> Bool)
-> (KeyVersion -> KeyVersion -> Bool) -> Eq KeyVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KeyVersion -> KeyVersion -> Bool
$c/= :: KeyVersion -> KeyVersion -> Bool
== :: KeyVersion -> KeyVersion -> Bool
$c== :: KeyVersion -> KeyVersion -> Bool
Eq, (forall x. KeyVersion -> Rep KeyVersion x)
-> (forall x. Rep KeyVersion x -> KeyVersion) -> Generic KeyVersion
forall x. Rep KeyVersion x -> KeyVersion
forall x. KeyVersion -> Rep KeyVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeyVersion x -> KeyVersion
$cfrom :: forall x. KeyVersion -> Rep KeyVersion x
Generic, Eq KeyVersion
Eq KeyVersion =>
(KeyVersion -> KeyVersion -> Ordering)
-> (KeyVersion -> KeyVersion -> Bool)
-> (KeyVersion -> KeyVersion -> Bool)
-> (KeyVersion -> KeyVersion -> Bool)
-> (KeyVersion -> KeyVersion -> Bool)
-> (KeyVersion -> KeyVersion -> KeyVersion)
-> (KeyVersion -> KeyVersion -> KeyVersion)
-> Ord KeyVersion
KeyVersion -> KeyVersion -> Bool
KeyVersion -> KeyVersion -> Ordering
KeyVersion -> KeyVersion -> KeyVersion
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
min :: KeyVersion -> KeyVersion -> KeyVersion
$cmin :: KeyVersion -> KeyVersion -> KeyVersion
max :: KeyVersion -> KeyVersion -> KeyVersion
$cmax :: KeyVersion -> KeyVersion -> KeyVersion
>= :: KeyVersion -> KeyVersion -> Bool
$c>= :: KeyVersion -> KeyVersion -> Bool
> :: KeyVersion -> KeyVersion -> Bool
$c> :: KeyVersion -> KeyVersion -> Bool
<= :: KeyVersion -> KeyVersion -> Bool
$c<= :: KeyVersion -> KeyVersion -> Bool
< :: KeyVersion -> KeyVersion -> Bool
$c< :: KeyVersion -> KeyVersion -> Bool
compare :: KeyVersion -> KeyVersion -> Ordering
$ccompare :: KeyVersion -> KeyVersion -> Ordering
$cp1Ord :: Eq KeyVersion
Ord, Int -> KeyVersion -> ShowS
[KeyVersion] -> ShowS
KeyVersion -> String
(Int -> KeyVersion -> ShowS)
-> (KeyVersion -> String)
-> ([KeyVersion] -> ShowS)
-> Show KeyVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyVersion] -> ShowS
$cshowList :: [KeyVersion] -> ShowS
show :: KeyVersion -> String
$cshow :: KeyVersion -> String
showsPrec :: Int -> KeyVersion -> ShowS
$cshowsPrec :: Int -> KeyVersion -> ShowS
Show, Typeable)

instance Hashable KeyVersion

instance Pretty KeyVersion where
  pretty :: KeyVersion -> Doc ann
pretty DeprecatedV3 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "(deprecated) v3"
  pretty V4 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "v4"

$(ATH.deriveJSON ATH.defaultOptions ''KeyVersion)

newtype IV =
  IV
    { IV -> ByteString
unIV :: B.ByteString
    }
  deriving ( IV -> Int
IV -> Ptr p -> IO ()
IV -> (Ptr p -> IO a) -> IO a
(IV -> Int)
-> (forall p a. IV -> (Ptr p -> IO a) -> IO a)
-> (forall p. IV -> Ptr p -> IO ())
-> ByteArrayAccess IV
forall p. IV -> Ptr p -> IO ()
forall ba.
(ba -> Int)
-> (forall p a. ba -> (Ptr p -> IO a) -> IO a)
-> (forall p. ba -> Ptr p -> IO ())
-> ByteArrayAccess ba
forall p a. IV -> (Ptr p -> IO a) -> IO a
copyByteArrayToPtr :: IV -> Ptr p -> IO ()
$ccopyByteArrayToPtr :: forall p. IV -> Ptr p -> IO ()
withByteArray :: IV -> (Ptr p -> IO a) -> IO a
$cwithByteArray :: forall p a. IV -> (Ptr p -> IO a) -> IO a
length :: IV -> Int
$clength :: IV -> Int
ByteArrayAccess
           , Typeable IV
Constr
DataType
Typeable IV =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> IV -> c IV)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c IV)
-> (IV -> Constr)
-> (IV -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c IV))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IV))
-> ((forall b. Data b => b -> b) -> IV -> IV)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IV -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IV -> r)
-> (forall u. (forall d. Data d => d -> u) -> IV -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> IV -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> IV -> m IV)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IV -> m IV)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> IV -> m IV)
-> Data IV
IV -> Constr
IV -> DataType
(forall b. Data b => b -> b) -> IV -> IV
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IV -> c IV
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IV
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) -> IV -> u
forall u. (forall d. Data d => d -> u) -> IV -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IV -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IV -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> IV -> m IV
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IV -> m IV
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IV
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IV -> c IV
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IV)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IV)
$cIV :: Constr
$tIV :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> IV -> m IV
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IV -> m IV
gmapMp :: (forall d. Data d => d -> m d) -> IV -> m IV
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> IV -> m IV
gmapM :: (forall d. Data d => d -> m d) -> IV -> m IV
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> IV -> m IV
gmapQi :: Int -> (forall d. Data d => d -> u) -> IV -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> IV -> u
gmapQ :: (forall d. Data d => d -> u) -> IV -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> IV -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IV -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IV -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IV -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IV -> r
gmapT :: (forall b. Data b => b -> b) -> IV -> IV
$cgmapT :: (forall b. Data b => b -> b) -> IV -> IV
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IV)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c IV)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c IV)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IV)
dataTypeOf :: IV -> DataType
$cdataTypeOf :: IV -> DataType
toConstr :: IV -> Constr
$ctoConstr :: IV -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IV
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IV
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IV -> c IV
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IV -> c IV
$cp1Data :: Typeable IV
Data
           , IV -> IV -> Bool
(IV -> IV -> Bool) -> (IV -> IV -> Bool) -> Eq IV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IV -> IV -> Bool
$c/= :: IV -> IV -> Bool
== :: IV -> IV -> Bool
$c== :: IV -> IV -> Bool
Eq
           , (forall x. IV -> Rep IV x)
-> (forall x. Rep IV x -> IV) -> Generic IV
forall x. Rep IV x -> IV
forall x. IV -> Rep IV x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IV x -> IV
$cfrom :: forall x. IV -> Rep IV x
Generic
           , Int -> IV -> Int
IV -> Int
(Int -> IV -> Int) -> (IV -> Int) -> Hashable IV
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: IV -> Int
$chash :: IV -> Int
hashWithSalt :: Int -> IV -> Int
$chashWithSalt :: Int -> IV -> Int
Hashable
           , b -> IV -> IV
NonEmpty IV -> IV
IV -> IV -> IV
(IV -> IV -> IV)
-> (NonEmpty IV -> IV)
-> (forall b. Integral b => b -> IV -> IV)
-> Semigroup IV
forall b. Integral b => b -> IV -> IV
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
stimes :: b -> IV -> IV
$cstimes :: forall b. Integral b => b -> IV -> IV
sconcat :: NonEmpty IV -> IV
$csconcat :: NonEmpty IV -> IV
<> :: IV -> IV -> IV
$c<> :: IV -> IV -> IV
Semigroup
           , Semigroup IV
IV
Semigroup IV => IV -> (IV -> IV -> IV) -> ([IV] -> IV) -> Monoid IV
[IV] -> IV
IV -> IV -> IV
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
mconcat :: [IV] -> IV
$cmconcat :: [IV] -> IV
mappend :: IV -> IV -> IV
$cmappend :: IV -> IV -> IV
mempty :: IV
$cmempty :: IV
$cp1Monoid :: Semigroup IV
Monoid
           , Int -> IV -> ShowS
[IV] -> ShowS
IV -> String
(Int -> IV -> ShowS)
-> (IV -> String) -> ([IV] -> ShowS) -> Show IV
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IV] -> ShowS
$cshowList :: [IV] -> ShowS
show :: IV -> String
$cshow :: IV -> String
showsPrec :: Int -> IV -> ShowS
$cshowsPrec :: Int -> IV -> ShowS
Show
           , Typeable
           )

instance Newtype IV B.ByteString where
  pack :: ByteString -> IV
pack = ByteString -> IV
IV
  unpack :: IV -> ByteString
unpack (IV o :: ByteString
o) = ByteString
o

instance Pretty IV where
  pretty :: IV -> Doc ann
pretty = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (String -> Doc ann) -> (IV -> String) -> IV -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ("iv:" String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> (IV -> String) -> IV -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> String
bsToHexUpper (ByteString -> String) -> (IV -> ByteString) -> IV -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> ByteString
BL.fromStrict (ByteString -> ByteString)
-> (IV -> ByteString) -> IV -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IV -> ByteString
forall n o. Newtype n o => n -> o
unpack

instance A.ToJSON IV where
  toJSON :: IV -> Value
toJSON = String -> Value
forall a. ToJSON a => a -> Value
A.toJSON (String -> Value) -> (IV -> String) -> IV -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> String
forall a. Show a => a -> String
show (ByteString -> String) -> (IV -> ByteString) -> IV -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IV -> ByteString
forall n o. Newtype n o => n -> o
unpack

data DataType
  = BinaryData
  | TextData
  | UTF8Data
  | OtherData Word8
  deriving (Int -> DataType -> ShowS
[DataType] -> ShowS
DataType -> String
(Int -> DataType -> ShowS)
-> (DataType -> String) -> ([DataType] -> ShowS) -> Show DataType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataType] -> ShowS
$cshowList :: [DataType] -> ShowS
show :: DataType -> String
$cshow :: DataType -> String
showsPrec :: Int -> DataType -> ShowS
$cshowsPrec :: Int -> DataType -> ShowS
Show, Typeable DataType
Constr
DataType
Typeable DataType =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> DataType -> c DataType)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c DataType)
-> (DataType -> Constr)
-> (DataType -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c DataType))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DataType))
-> ((forall b. Data b => b -> b) -> DataType -> DataType)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DataType -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DataType -> r)
-> (forall u. (forall d. Data d => d -> u) -> DataType -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> DataType -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> DataType -> m DataType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DataType -> m DataType)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> DataType -> m DataType)
-> Data DataType
DataType -> Constr
DataType -> DataType
(forall b. Data b => b -> b) -> DataType -> DataType
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DataType -> c DataType
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DataType
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) -> DataType -> u
forall u. (forall d. Data d => d -> u) -> DataType -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DataType -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DataType -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DataType -> m DataType
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DataType -> m DataType
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DataType
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DataType -> c DataType
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DataType)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DataType)
$cOtherData :: Constr
$cUTF8Data :: Constr
$cTextData :: Constr
$cBinaryData :: Constr
$tDataType :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> DataType -> m DataType
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DataType -> m DataType
gmapMp :: (forall d. Data d => d -> m d) -> DataType -> m DataType
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> DataType -> m DataType
gmapM :: (forall d. Data d => d -> m d) -> DataType -> m DataType
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> DataType -> m DataType
gmapQi :: Int -> (forall d. Data d => d -> u) -> DataType -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> DataType -> u
gmapQ :: (forall d. Data d => d -> u) -> DataType -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> DataType -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DataType -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DataType -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DataType -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DataType -> r
gmapT :: (forall b. Data b => b -> b) -> DataType -> DataType
$cgmapT :: (forall b. Data b => b -> b) -> DataType -> DataType
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DataType)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DataType)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c DataType)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c DataType)
dataTypeOf :: DataType -> DataType
$cdataTypeOf :: DataType -> DataType
toConstr :: DataType -> Constr
$ctoConstr :: DataType -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DataType
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c DataType
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DataType -> c DataType
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> DataType -> c DataType
$cp1Data :: Typeable DataType
Data, (forall x. DataType -> Rep DataType x)
-> (forall x. Rep DataType x -> DataType) -> Generic DataType
forall x. Rep DataType x -> DataType
forall x. DataType -> Rep DataType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataType x -> DataType
$cfrom :: forall x. DataType -> Rep DataType x
Generic, Typeable)

instance Hashable DataType

instance Eq DataType where
  == :: DataType -> DataType -> Bool
(==) a :: DataType
a b :: DataType
b = DataType -> Word8
forall a. FutureVal a => a -> Word8
fromFVal DataType
a Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
== DataType -> Word8
forall a. FutureVal a => a -> Word8
fromFVal DataType
b

instance Ord DataType where
  compare :: DataType -> DataType -> Ordering
compare = (DataType -> Word8) -> DataType -> DataType -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing DataType -> Word8
forall a. FutureVal a => a -> Word8
fromFVal

instance FutureVal DataType where
  fromFVal :: DataType -> Word8
fromFVal BinaryData = Int -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word8) -> (Char -> Int) -> Char -> Word8
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
forall a. Enum a => a -> Int
fromEnum (Char -> Word8) -> Char -> Word8
forall a b. (a -> b) -> a -> b
$ 'b'
  fromFVal TextData = Int -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word8) -> (Char -> Int) -> Char -> Word8
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
forall a. Enum a => a -> Int
fromEnum (Char -> Word8) -> Char -> Word8
forall a b. (a -> b) -> a -> b
$ 't'
  fromFVal UTF8Data = Int -> Word8
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word8) -> (Char -> Int) -> Char -> Word8
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> Int
forall a. Enum a => a -> Int
fromEnum (Char -> Word8) -> Char -> Word8
forall a b. (a -> b) -> a -> b
$ 'u'
  fromFVal (OtherData o :: Word8
o) = Word8
o
  toFVal :: Word8 -> DataType
toFVal 0x62 = DataType
BinaryData
  toFVal 0x74 = DataType
TextData
  toFVal 0x75 = DataType
UTF8Data
  toFVal o :: Word8
o = Word8 -> DataType
OtherData Word8
o

instance Pretty DataType where
  pretty :: DataType -> Doc ann
pretty BinaryData = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "binary"
  pretty TextData = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "text"
  pretty UTF8Data = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "UTF-8"
  pretty (OtherData o :: Word8
o) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "other data type " Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
o

$(ATH.deriveJSON ATH.defaultOptions ''DataType)

newtype Salt =
  Salt
    { Salt -> ByteString
unSalt :: B.ByteString
    }
  deriving (Typeable Salt
Constr
DataType
Typeable Salt =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Salt -> c Salt)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Salt)
-> (Salt -> Constr)
-> (Salt -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Salt))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Salt))
-> ((forall b. Data b => b -> b) -> Salt -> Salt)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r)
-> (forall u. (forall d. Data d => d -> u) -> Salt -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Salt -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Salt -> m Salt)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Salt -> m Salt)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Salt -> m Salt)
-> Data Salt
Salt -> Constr
Salt -> DataType
(forall b. Data b => b -> b) -> Salt -> Salt
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Salt -> c Salt
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Salt
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) -> Salt -> u
forall u. (forall d. Data d => d -> u) -> Salt -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Salt -> m Salt
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Salt -> m Salt
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Salt
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Salt -> c Salt
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Salt)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Salt)
$cSalt :: Constr
$tSalt :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Salt -> m Salt
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Salt -> m Salt
gmapMp :: (forall d. Data d => d -> m d) -> Salt -> m Salt
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Salt -> m Salt
gmapM :: (forall d. Data d => d -> m d) -> Salt -> m Salt
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Salt -> m Salt
gmapQi :: Int -> (forall d. Data d => d -> u) -> Salt -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Salt -> u
gmapQ :: (forall d. Data d => d -> u) -> Salt -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Salt -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Salt -> r
gmapT :: (forall b. Data b => b -> b) -> Salt -> Salt
$cgmapT :: (forall b. Data b => b -> b) -> Salt -> Salt
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Salt)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Salt)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Salt)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Salt)
dataTypeOf :: Salt -> DataType
$cdataTypeOf :: Salt -> DataType
toConstr :: Salt -> Constr
$ctoConstr :: Salt -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Salt
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Salt
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Salt -> c Salt
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Salt -> c Salt
$cp1Data :: Typeable Salt
Data, Salt -> Salt -> Bool
(Salt -> Salt -> Bool) -> (Salt -> Salt -> Bool) -> Eq Salt
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Salt -> Salt -> Bool
$c/= :: Salt -> Salt -> Bool
== :: Salt -> Salt -> Bool
$c== :: Salt -> Salt -> Bool
Eq, (forall x. Salt -> Rep Salt x)
-> (forall x. Rep Salt x -> Salt) -> Generic Salt
forall x. Rep Salt x -> Salt
forall x. Salt -> Rep Salt x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Salt x -> Salt
$cfrom :: forall x. Salt -> Rep Salt x
Generic, Int -> Salt -> Int
Salt -> Int
(Int -> Salt -> Int) -> (Salt -> Int) -> Hashable Salt
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: Salt -> Int
$chash :: Salt -> Int
hashWithSalt :: Int -> Salt -> Int
$chashWithSalt :: Int -> Salt -> Int
Hashable, Int -> Salt -> ShowS
[Salt] -> ShowS
Salt -> String
(Int -> Salt -> ShowS)
-> (Salt -> String) -> ([Salt] -> ShowS) -> Show Salt
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Salt] -> ShowS
$cshowList :: [Salt] -> ShowS
show :: Salt -> String
$cshow :: Salt -> String
showsPrec :: Int -> Salt -> ShowS
$cshowsPrec :: Int -> Salt -> ShowS
Show, Typeable)

instance Newtype Salt B.ByteString where
  pack :: ByteString -> Salt
pack = ByteString -> Salt
Salt
  unpack :: Salt -> ByteString
unpack (Salt o :: ByteString
o) = ByteString
o

instance Pretty Salt where
  pretty :: Salt -> Doc ann
pretty = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (String -> Doc ann) -> (Salt -> String) -> Salt -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ("salt:" String -> ShowS
forall a. [a] -> [a] -> [a]
++) ShowS -> (Salt -> String) -> Salt -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> String
bsToHexUpper (ByteString -> String) -> (Salt -> ByteString) -> Salt -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> ByteString
BL.fromStrict (ByteString -> ByteString)
-> (Salt -> ByteString) -> Salt -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Salt -> ByteString
forall n o. Newtype n o => n -> o
unpack

instance A.ToJSON Salt where
  toJSON :: Salt -> Value
toJSON = String -> Value
forall a. ToJSON a => a -> Value
A.toJSON (String -> Value) -> (Salt -> String) -> Salt -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> String
forall a. Show a => a -> String
show (ByteString -> String) -> (Salt -> ByteString) -> Salt -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Salt -> ByteString
forall n o. Newtype n o => n -> o
unpack

newtype IterationCount =
  IterationCount
    { IterationCount -> Int
unIterationCount :: Int
    }
  deriving ( IterationCount
IterationCount -> IterationCount -> Bounded IterationCount
forall a. a -> a -> Bounded a
maxBound :: IterationCount
$cmaxBound :: IterationCount
minBound :: IterationCount
$cminBound :: IterationCount
Bounded
           , Typeable IterationCount
Constr
DataType
Typeable IterationCount =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> IterationCount -> c IterationCount)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c IterationCount)
-> (IterationCount -> Constr)
-> (IterationCount -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c IterationCount))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c IterationCount))
-> ((forall b. Data b => b -> b)
    -> IterationCount -> IterationCount)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> IterationCount -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> IterationCount -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> IterationCount -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> IterationCount -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> IterationCount -> m IterationCount)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> IterationCount -> m IterationCount)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> IterationCount -> m IterationCount)
-> Data IterationCount
IterationCount -> Constr
IterationCount -> DataType
(forall b. Data b => b -> b) -> IterationCount -> IterationCount
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IterationCount -> c IterationCount
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IterationCount
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) -> IterationCount -> u
forall u. (forall d. Data d => d -> u) -> IterationCount -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IterationCount -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IterationCount -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> IterationCount -> m IterationCount
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> IterationCount -> m IterationCount
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IterationCount
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IterationCount -> c IterationCount
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IterationCount)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IterationCount)
$cIterationCount :: Constr
$tIterationCount :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> IterationCount -> m IterationCount
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> IterationCount -> m IterationCount
gmapMp :: (forall d. Data d => d -> m d)
-> IterationCount -> m IterationCount
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> IterationCount -> m IterationCount
gmapM :: (forall d. Data d => d -> m d)
-> IterationCount -> m IterationCount
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> IterationCount -> m IterationCount
gmapQi :: Int -> (forall d. Data d => d -> u) -> IterationCount -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> IterationCount -> u
gmapQ :: (forall d. Data d => d -> u) -> IterationCount -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> IterationCount -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IterationCount -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> IterationCount -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IterationCount -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> IterationCount -> r
gmapT :: (forall b. Data b => b -> b) -> IterationCount -> IterationCount
$cgmapT :: (forall b. Data b => b -> b) -> IterationCount -> IterationCount
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IterationCount)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c IterationCount)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c IterationCount)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c IterationCount)
dataTypeOf :: IterationCount -> DataType
$cdataTypeOf :: IterationCount -> DataType
toConstr :: IterationCount -> Constr
$ctoConstr :: IterationCount -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IterationCount
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c IterationCount
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IterationCount -> c IterationCount
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> IterationCount -> c IterationCount
$cp1Data :: Typeable IterationCount
Data
           , Int -> IterationCount
IterationCount -> Int
IterationCount -> [IterationCount]
IterationCount -> IterationCount
IterationCount -> IterationCount -> [IterationCount]
IterationCount
-> IterationCount -> IterationCount -> [IterationCount]
(IterationCount -> IterationCount)
-> (IterationCount -> IterationCount)
-> (Int -> IterationCount)
-> (IterationCount -> Int)
-> (IterationCount -> [IterationCount])
-> (IterationCount -> IterationCount -> [IterationCount])
-> (IterationCount -> IterationCount -> [IterationCount])
-> (IterationCount
    -> IterationCount -> IterationCount -> [IterationCount])
-> Enum IterationCount
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: IterationCount
-> IterationCount -> IterationCount -> [IterationCount]
$cenumFromThenTo :: IterationCount
-> IterationCount -> IterationCount -> [IterationCount]
enumFromTo :: IterationCount -> IterationCount -> [IterationCount]
$cenumFromTo :: IterationCount -> IterationCount -> [IterationCount]
enumFromThen :: IterationCount -> IterationCount -> [IterationCount]
$cenumFromThen :: IterationCount -> IterationCount -> [IterationCount]
enumFrom :: IterationCount -> [IterationCount]
$cenumFrom :: IterationCount -> [IterationCount]
fromEnum :: IterationCount -> Int
$cfromEnum :: IterationCount -> Int
toEnum :: Int -> IterationCount
$ctoEnum :: Int -> IterationCount
pred :: IterationCount -> IterationCount
$cpred :: IterationCount -> IterationCount
succ :: IterationCount -> IterationCount
$csucc :: IterationCount -> IterationCount
Enum
           , IterationCount -> IterationCount -> Bool
(IterationCount -> IterationCount -> Bool)
-> (IterationCount -> IterationCount -> Bool) -> Eq IterationCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IterationCount -> IterationCount -> Bool
$c/= :: IterationCount -> IterationCount -> Bool
== :: IterationCount -> IterationCount -> Bool
$c== :: IterationCount -> IterationCount -> Bool
Eq
           , (forall x. IterationCount -> Rep IterationCount x)
-> (forall x. Rep IterationCount x -> IterationCount)
-> Generic IterationCount
forall x. Rep IterationCount x -> IterationCount
forall x. IterationCount -> Rep IterationCount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IterationCount x -> IterationCount
$cfrom :: forall x. IterationCount -> Rep IterationCount x
Generic
           , Int -> IterationCount -> Int
IterationCount -> Int
(Int -> IterationCount -> Int)
-> (IterationCount -> Int) -> Hashable IterationCount
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: IterationCount -> Int
$chash :: IterationCount -> Int
hashWithSalt :: Int -> IterationCount -> Int
$chashWithSalt :: Int -> IterationCount -> Int
Hashable
           , Enum IterationCount
Real IterationCount
(Real IterationCount, Enum IterationCount) =>
(IterationCount -> IterationCount -> IterationCount)
-> (IterationCount -> IterationCount -> IterationCount)
-> (IterationCount -> IterationCount -> IterationCount)
-> (IterationCount -> IterationCount -> IterationCount)
-> (IterationCount
    -> IterationCount -> (IterationCount, IterationCount))
-> (IterationCount
    -> IterationCount -> (IterationCount, IterationCount))
-> (IterationCount -> Integer)
-> Integral IterationCount
IterationCount -> Integer
IterationCount
-> IterationCount -> (IterationCount, IterationCount)
IterationCount -> IterationCount -> IterationCount
forall a.
(Real a, Enum a) =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
toInteger :: IterationCount -> Integer
$ctoInteger :: IterationCount -> Integer
divMod :: IterationCount
-> IterationCount -> (IterationCount, IterationCount)
$cdivMod :: IterationCount
-> IterationCount -> (IterationCount, IterationCount)
quotRem :: IterationCount
-> IterationCount -> (IterationCount, IterationCount)
$cquotRem :: IterationCount
-> IterationCount -> (IterationCount, IterationCount)
mod :: IterationCount -> IterationCount -> IterationCount
$cmod :: IterationCount -> IterationCount -> IterationCount
div :: IterationCount -> IterationCount -> IterationCount
$cdiv :: IterationCount -> IterationCount -> IterationCount
rem :: IterationCount -> IterationCount -> IterationCount
$crem :: IterationCount -> IterationCount -> IterationCount
quot :: IterationCount -> IterationCount -> IterationCount
$cquot :: IterationCount -> IterationCount -> IterationCount
$cp2Integral :: Enum IterationCount
$cp1Integral :: Real IterationCount
Integral
           , Integer -> IterationCount
IterationCount -> IterationCount
IterationCount -> IterationCount -> IterationCount
(IterationCount -> IterationCount -> IterationCount)
-> (IterationCount -> IterationCount -> IterationCount)
-> (IterationCount -> IterationCount -> IterationCount)
-> (IterationCount -> IterationCount)
-> (IterationCount -> IterationCount)
-> (IterationCount -> IterationCount)
-> (Integer -> IterationCount)
-> Num IterationCount
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> IterationCount
$cfromInteger :: Integer -> IterationCount
signum :: IterationCount -> IterationCount
$csignum :: IterationCount -> IterationCount
abs :: IterationCount -> IterationCount
$cabs :: IterationCount -> IterationCount
negate :: IterationCount -> IterationCount
$cnegate :: IterationCount -> IterationCount
* :: IterationCount -> IterationCount -> IterationCount
$c* :: IterationCount -> IterationCount -> IterationCount
- :: IterationCount -> IterationCount -> IterationCount
$c- :: IterationCount -> IterationCount -> IterationCount
+ :: IterationCount -> IterationCount -> IterationCount
$c+ :: IterationCount -> IterationCount -> IterationCount
Num
           , Eq IterationCount
Eq IterationCount =>
(IterationCount -> IterationCount -> Ordering)
-> (IterationCount -> IterationCount -> Bool)
-> (IterationCount -> IterationCount -> Bool)
-> (IterationCount -> IterationCount -> Bool)
-> (IterationCount -> IterationCount -> Bool)
-> (IterationCount -> IterationCount -> IterationCount)
-> (IterationCount -> IterationCount -> IterationCount)
-> Ord IterationCount
IterationCount -> IterationCount -> Bool
IterationCount -> IterationCount -> Ordering
IterationCount -> IterationCount -> IterationCount
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
min :: IterationCount -> IterationCount -> IterationCount
$cmin :: IterationCount -> IterationCount -> IterationCount
max :: IterationCount -> IterationCount -> IterationCount
$cmax :: IterationCount -> IterationCount -> IterationCount
>= :: IterationCount -> IterationCount -> Bool
$c>= :: IterationCount -> IterationCount -> Bool
> :: IterationCount -> IterationCount -> Bool
$c> :: IterationCount -> IterationCount -> Bool
<= :: IterationCount -> IterationCount -> Bool
$c<= :: IterationCount -> IterationCount -> Bool
< :: IterationCount -> IterationCount -> Bool
$c< :: IterationCount -> IterationCount -> Bool
compare :: IterationCount -> IterationCount -> Ordering
$ccompare :: IterationCount -> IterationCount -> Ordering
$cp1Ord :: Eq IterationCount
Ord
           , Num IterationCount
Ord IterationCount
(Num IterationCount, Ord IterationCount) =>
(IterationCount -> Rational) -> Real IterationCount
IterationCount -> Rational
forall a. (Num a, Ord a) => (a -> Rational) -> Real a
toRational :: IterationCount -> Rational
$ctoRational :: IterationCount -> Rational
$cp2Real :: Ord IterationCount
$cp1Real :: Num IterationCount
Real
           , Int -> IterationCount -> ShowS
[IterationCount] -> ShowS
IterationCount -> String
(Int -> IterationCount -> ShowS)
-> (IterationCount -> String)
-> ([IterationCount] -> ShowS)
-> Show IterationCount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IterationCount] -> ShowS
$cshowList :: [IterationCount] -> ShowS
show :: IterationCount -> String
$cshow :: IterationCount -> String
showsPrec :: Int -> IterationCount -> ShowS
$cshowsPrec :: Int -> IterationCount -> ShowS
Show
           , Typeable
           )

instance Newtype IterationCount Int where
  pack :: Int -> IterationCount
pack = Int -> IterationCount
IterationCount
  unpack :: IterationCount -> Int
unpack (IterationCount o :: Int
o) = Int
o

instance Pretty IterationCount where
  pretty :: IterationCount -> Doc ann
pretty = Int -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (Int -> Doc ann)
-> (IterationCount -> Int) -> IterationCount -> Doc ann
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IterationCount -> Int
forall n o. Newtype n o => n -> o
unpack

$(ATH.deriveJSON ATH.defaultOptions ''IterationCount)

data S2K
  = Simple HashAlgorithm
  | Salted HashAlgorithm Salt
  | IteratedSalted HashAlgorithm Salt IterationCount
  | OtherS2K Word8 ByteString
  deriving (Typeable S2K
Constr
DataType
Typeable S2K =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> S2K -> c S2K)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c S2K)
-> (S2K -> Constr)
-> (S2K -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c S2K))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c S2K))
-> ((forall b. Data b => b -> b) -> S2K -> S2K)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> S2K -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> S2K -> r)
-> (forall u. (forall d. Data d => d -> u) -> S2K -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> S2K -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> S2K -> m S2K)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> S2K -> m S2K)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> S2K -> m S2K)
-> Data S2K
S2K -> Constr
S2K -> DataType
(forall b. Data b => b -> b) -> S2K -> S2K
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> S2K -> c S2K
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c S2K
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) -> S2K -> u
forall u. (forall d. Data d => d -> u) -> S2K -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> S2K -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> S2K -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> S2K -> m S2K
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> S2K -> m S2K
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c S2K
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> S2K -> c S2K
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c S2K)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c S2K)
$cOtherS2K :: Constr
$cIteratedSalted :: Constr
$cSalted :: Constr
$cSimple :: Constr
$tS2K :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> S2K -> m S2K
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> S2K -> m S2K
gmapMp :: (forall d. Data d => d -> m d) -> S2K -> m S2K
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> S2K -> m S2K
gmapM :: (forall d. Data d => d -> m d) -> S2K -> m S2K
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> S2K -> m S2K
gmapQi :: Int -> (forall d. Data d => d -> u) -> S2K -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> S2K -> u
gmapQ :: (forall d. Data d => d -> u) -> S2K -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> S2K -> [u]
gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> S2K -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> S2K -> r
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> S2K -> r
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> S2K -> r
gmapT :: (forall b. Data b => b -> b) -> S2K -> S2K
$cgmapT :: (forall b. Data b => b -> b) -> S2K -> S2K
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c S2K)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c S2K)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c S2K)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c S2K)
dataTypeOf :: S2K -> DataType
$cdataTypeOf :: S2K -> DataType
toConstr :: S2K -> Constr
$ctoConstr :: S2K -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c S2K
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c S2K
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> S2K -> c S2K
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> S2K -> c S2K
$cp1Data :: Typeable S2K
Data, S2K -> S2K -> Bool
(S2K -> S2K -> Bool) -> (S2K -> S2K -> Bool) -> Eq S2K
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S2K -> S2K -> Bool
$c/= :: S2K -> S2K -> Bool
== :: S2K -> S2K -> Bool
$c== :: S2K -> S2K -> Bool
Eq, (forall x. S2K -> Rep S2K x)
-> (forall x. Rep S2K x -> S2K) -> Generic S2K
forall x. Rep S2K x -> S2K
forall x. S2K -> Rep S2K x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S2K x -> S2K
$cfrom :: forall x. S2K -> Rep S2K x
Generic, Int -> S2K -> ShowS
[S2K] -> ShowS
S2K -> String
(Int -> S2K -> ShowS)
-> (S2K -> String) -> ([S2K] -> ShowS) -> Show S2K
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S2K] -> ShowS
$cshowList :: [S2K] -> ShowS
show :: S2K -> String
$cshow :: S2K -> String
showsPrec :: Int -> S2K -> ShowS
$cshowsPrec :: Int -> S2K -> ShowS
Show, Typeable)

instance Hashable S2K

instance Pretty S2K where
  pretty :: S2K -> Doc ann
pretty (Simple ha :: HashAlgorithm
ha) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "simple S2K," Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> HashAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty HashAlgorithm
ha
  pretty (Salted ha :: HashAlgorithm
ha salt :: Salt
salt) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "salted S2K," Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> HashAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty HashAlgorithm
ha Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Salt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Salt
salt
  pretty (IteratedSalted ha :: HashAlgorithm
ha salt :: Salt
salt icount :: IterationCount
icount) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "iterated-salted S2K," Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+>
    HashAlgorithm -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty HashAlgorithm
ha Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Salt -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Salt
salt Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> IterationCount -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty IterationCount
icount
  pretty (OtherS2K t :: Word8
t bs :: ByteString
bs) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown S2K type" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
t Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (ByteString -> String
bsToHexUpper ByteString
bs)

instance A.ToJSON S2K where
  toJSON :: S2K -> Value
toJSON (Simple ha :: HashAlgorithm
ha) = HashAlgorithm -> Value
forall a. ToJSON a => a -> Value
A.toJSON HashAlgorithm
ha
  toJSON (Salted ha :: HashAlgorithm
ha salt :: Salt
salt) = (HashAlgorithm, Salt) -> Value
forall a. ToJSON a => a -> Value
A.toJSON (HashAlgorithm
ha, Salt
salt)
  toJSON (IteratedSalted ha :: HashAlgorithm
ha salt :: Salt
salt icount :: IterationCount
icount) = (HashAlgorithm, Salt, IterationCount) -> Value
forall a. ToJSON a => a -> Value
A.toJSON (HashAlgorithm
ha, Salt
salt, IterationCount
icount)
  toJSON (OtherS2K t :: Word8
t bs :: ByteString
bs) = (Word8, [Word8]) -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Word8
t, ByteString -> [Word8]
BL.unpack ByteString
bs)

data ImageFormat
  = JPEG
  | OtherImage Word8
  deriving (Typeable ImageFormat
Constr
DataType
Typeable ImageFormat =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> ImageFormat -> c ImageFormat)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ImageFormat)
-> (ImageFormat -> Constr)
-> (ImageFormat -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ImageFormat))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ImageFormat))
-> ((forall b. Data b => b -> b) -> ImageFormat -> ImageFormat)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ImageFormat -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ImageFormat -> r)
-> (forall u. (forall d. Data d => d -> u) -> ImageFormat -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ImageFormat -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat)
-> Data ImageFormat
ImageFormat -> Constr
ImageFormat -> DataType
(forall b. Data b => b -> b) -> ImageFormat -> ImageFormat
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ImageFormat -> c ImageFormat
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ImageFormat
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) -> ImageFormat -> u
forall u. (forall d. Data d => d -> u) -> ImageFormat -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ImageFormat -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ImageFormat -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ImageFormat
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ImageFormat -> c ImageFormat
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ImageFormat)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ImageFormat)
$cOtherImage :: Constr
$cJPEG :: Constr
$tImageFormat :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat
gmapMp :: (forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat
gmapM :: (forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ImageFormat -> m ImageFormat
gmapQi :: Int -> (forall d. Data d => d -> u) -> ImageFormat -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ImageFormat -> u
gmapQ :: (forall d. Data d => d -> u) -> ImageFormat -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ImageFormat -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ImageFormat -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ImageFormat -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ImageFormat -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ImageFormat -> r
gmapT :: (forall b. Data b => b -> b) -> ImageFormat -> ImageFormat
$cgmapT :: (forall b. Data b => b -> b) -> ImageFormat -> ImageFormat
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ImageFormat)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ImageFormat)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ImageFormat)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ImageFormat)
dataTypeOf :: ImageFormat -> DataType
$cdataTypeOf :: ImageFormat -> DataType
toConstr :: ImageFormat -> Constr
$ctoConstr :: ImageFormat -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ImageFormat
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ImageFormat
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ImageFormat -> c ImageFormat
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ImageFormat -> c ImageFormat
$cp1Data :: Typeable ImageFormat
Data, (forall x. ImageFormat -> Rep ImageFormat x)
-> (forall x. Rep ImageFormat x -> ImageFormat)
-> Generic ImageFormat
forall x. Rep ImageFormat x -> ImageFormat
forall x. ImageFormat -> Rep ImageFormat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageFormat x -> ImageFormat
$cfrom :: forall x. ImageFormat -> Rep ImageFormat x
Generic, Int -> ImageFormat -> ShowS
[ImageFormat] -> ShowS
ImageFormat -> String
(Int -> ImageFormat -> ShowS)
-> (ImageFormat -> String)
-> ([ImageFormat] -> ShowS)
-> Show ImageFormat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageFormat] -> ShowS
$cshowList :: [ImageFormat] -> ShowS
show :: ImageFormat -> String
$cshow :: ImageFormat -> String
showsPrec :: Int -> ImageFormat -> ShowS
$cshowsPrec :: Int -> ImageFormat -> ShowS
Show, Typeable)

instance Eq ImageFormat where
  == :: ImageFormat -> ImageFormat -> Bool
(==) a :: ImageFormat
a b :: ImageFormat
b = ImageFormat -> Word8
forall a. FutureVal a => a -> Word8
fromFVal ImageFormat
a Word8 -> Word8 -> Bool
forall a. Eq a => a -> a -> Bool
== ImageFormat -> Word8
forall a. FutureVal a => a -> Word8
fromFVal ImageFormat
b

instance Ord ImageFormat where
  compare :: ImageFormat -> ImageFormat -> Ordering
compare = (ImageFormat -> Word8) -> ImageFormat -> ImageFormat -> Ordering
forall a b. Ord a => (b -> a) -> b -> b -> Ordering
comparing ImageFormat -> Word8
forall a. FutureVal a => a -> Word8
fromFVal

instance FutureVal ImageFormat where
  fromFVal :: ImageFormat -> Word8
fromFVal JPEG = 1
  fromFVal (OtherImage o :: Word8
o) = Word8
o
  toFVal :: Word8 -> ImageFormat
toFVal 1 = ImageFormat
JPEG
  toFVal o :: Word8
o = Word8 -> ImageFormat
OtherImage Word8
o

instance Hashable ImageFormat

instance Pretty ImageFormat where
  pretty :: ImageFormat -> Doc ann
pretty JPEG = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "JPEG"
  pretty (OtherImage o :: Word8
o) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown image format" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
o

$(ATH.deriveJSON ATH.defaultOptions ''ImageFormat)

newtype ImageHeader =
  ImageHV1 ImageFormat
  deriving (Typeable ImageHeader
Constr
DataType
Typeable ImageHeader =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> ImageHeader -> c ImageHeader)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ImageHeader)
-> (ImageHeader -> Constr)
-> (ImageHeader -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ImageHeader))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ImageHeader))
-> ((forall b. Data b => b -> b) -> ImageHeader -> ImageHeader)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ImageHeader -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ImageHeader -> r)
-> (forall u. (forall d. Data d => d -> u) -> ImageHeader -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ImageHeader -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader)
-> Data ImageHeader
ImageHeader -> Constr
ImageHeader -> DataType
(forall b. Data b => b -> b) -> ImageHeader -> ImageHeader
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ImageHeader -> c ImageHeader
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ImageHeader
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) -> ImageHeader -> u
forall u. (forall d. Data d => d -> u) -> ImageHeader -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ImageHeader -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ImageHeader -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ImageHeader
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ImageHeader -> c ImageHeader
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ImageHeader)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ImageHeader)
$cImageHV1 :: Constr
$tImageHeader :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader
gmapMp :: (forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader
gmapM :: (forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ImageHeader -> m ImageHeader
gmapQi :: Int -> (forall d. Data d => d -> u) -> ImageHeader -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ImageHeader -> u
gmapQ :: (forall d. Data d => d -> u) -> ImageHeader -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ImageHeader -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ImageHeader -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ImageHeader -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ImageHeader -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ImageHeader -> r
gmapT :: (forall b. Data b => b -> b) -> ImageHeader -> ImageHeader
$cgmapT :: (forall b. Data b => b -> b) -> ImageHeader -> ImageHeader
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ImageHeader)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ImageHeader)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ImageHeader)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ImageHeader)
dataTypeOf :: ImageHeader -> DataType
$cdataTypeOf :: ImageHeader -> DataType
toConstr :: ImageHeader -> Constr
$ctoConstr :: ImageHeader -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ImageHeader
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ImageHeader
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ImageHeader -> c ImageHeader
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ImageHeader -> c ImageHeader
$cp1Data :: Typeable ImageHeader
Data, ImageHeader -> ImageHeader -> Bool
(ImageHeader -> ImageHeader -> Bool)
-> (ImageHeader -> ImageHeader -> Bool) -> Eq ImageHeader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageHeader -> ImageHeader -> Bool
$c/= :: ImageHeader -> ImageHeader -> Bool
== :: ImageHeader -> ImageHeader -> Bool
$c== :: ImageHeader -> ImageHeader -> Bool
Eq, (forall x. ImageHeader -> Rep ImageHeader x)
-> (forall x. Rep ImageHeader x -> ImageHeader)
-> Generic ImageHeader
forall x. Rep ImageHeader x -> ImageHeader
forall x. ImageHeader -> Rep ImageHeader x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImageHeader x -> ImageHeader
$cfrom :: forall x. ImageHeader -> Rep ImageHeader x
Generic, Int -> ImageHeader -> ShowS
[ImageHeader] -> ShowS
ImageHeader -> String
(Int -> ImageHeader -> ShowS)
-> (ImageHeader -> String)
-> ([ImageHeader] -> ShowS)
-> Show ImageHeader
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImageHeader] -> ShowS
$cshowList :: [ImageHeader] -> ShowS
show :: ImageHeader -> String
$cshow :: ImageHeader -> String
showsPrec :: Int -> ImageHeader -> ShowS
$cshowsPrec :: Int -> ImageHeader -> ShowS
Show, Typeable)

instance Ord ImageHeader where
  compare :: ImageHeader -> ImageHeader -> Ordering
compare (ImageHV1 a :: ImageFormat
a) (ImageHV1 b :: ImageFormat
b) = ImageFormat -> ImageFormat -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ImageFormat
a ImageFormat
b

instance Hashable ImageHeader

instance Pretty ImageHeader where
  pretty :: ImageHeader -> Doc ann
pretty (ImageHV1 f :: ImageFormat
f) = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "imghdr v1" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ImageFormat -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ImageFormat
f

$(ATH.deriveJSON ATH.defaultOptions ''ImageHeader)

data UserAttrSubPacket
  = ImageAttribute ImageHeader ImageData
  | OtherUASub Word8 ByteString
  deriving (Typeable UserAttrSubPacket
Constr
DataType
Typeable UserAttrSubPacket =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g)
 -> UserAttrSubPacket
 -> c UserAttrSubPacket)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c UserAttrSubPacket)
-> (UserAttrSubPacket -> Constr)
-> (UserAttrSubPacket -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c UserAttrSubPacket))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c UserAttrSubPacket))
-> ((forall b. Data b => b -> b)
    -> UserAttrSubPacket -> UserAttrSubPacket)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> UserAttrSubPacket -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> UserAttrSubPacket -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> UserAttrSubPacket -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> UserAttrSubPacket -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> UserAttrSubPacket -> m UserAttrSubPacket)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> UserAttrSubPacket -> m UserAttrSubPacket)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> UserAttrSubPacket -> m UserAttrSubPacket)
-> Data UserAttrSubPacket
UserAttrSubPacket -> Constr
UserAttrSubPacket -> DataType
(forall b. Data b => b -> b)
-> UserAttrSubPacket -> UserAttrSubPacket
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserAttrSubPacket -> c UserAttrSubPacket
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserAttrSubPacket
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) -> UserAttrSubPacket -> u
forall u. (forall d. Data d => d -> u) -> UserAttrSubPacket -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttrSubPacket -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttrSubPacket -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UserAttrSubPacket -> m UserAttrSubPacket
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UserAttrSubPacket -> m UserAttrSubPacket
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserAttrSubPacket
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserAttrSubPacket -> c UserAttrSubPacket
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserAttrSubPacket)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UserAttrSubPacket)
$cOtherUASub :: Constr
$cImageAttribute :: Constr
$tUserAttrSubPacket :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> UserAttrSubPacket -> m UserAttrSubPacket
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UserAttrSubPacket -> m UserAttrSubPacket
gmapMp :: (forall d. Data d => d -> m d)
-> UserAttrSubPacket -> m UserAttrSubPacket
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UserAttrSubPacket -> m UserAttrSubPacket
gmapM :: (forall d. Data d => d -> m d)
-> UserAttrSubPacket -> m UserAttrSubPacket
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UserAttrSubPacket -> m UserAttrSubPacket
gmapQi :: Int -> (forall d. Data d => d -> u) -> UserAttrSubPacket -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> UserAttrSubPacket -> u
gmapQ :: (forall d. Data d => d -> u) -> UserAttrSubPacket -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> UserAttrSubPacket -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttrSubPacket -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttrSubPacket -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttrSubPacket -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UserAttrSubPacket -> r
gmapT :: (forall b. Data b => b -> b)
-> UserAttrSubPacket -> UserAttrSubPacket
$cgmapT :: (forall b. Data b => b -> b)
-> UserAttrSubPacket -> UserAttrSubPacket
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UserAttrSubPacket)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UserAttrSubPacket)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c UserAttrSubPacket)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UserAttrSubPacket)
dataTypeOf :: UserAttrSubPacket -> DataType
$cdataTypeOf :: UserAttrSubPacket -> DataType
toConstr :: UserAttrSubPacket -> Constr
$ctoConstr :: UserAttrSubPacket -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserAttrSubPacket
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UserAttrSubPacket
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserAttrSubPacket -> c UserAttrSubPacket
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UserAttrSubPacket -> c UserAttrSubPacket
$cp1Data :: Typeable UserAttrSubPacket
Data, UserAttrSubPacket -> UserAttrSubPacket -> Bool
(UserAttrSubPacket -> UserAttrSubPacket -> Bool)
-> (UserAttrSubPacket -> UserAttrSubPacket -> Bool)
-> Eq UserAttrSubPacket
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserAttrSubPacket -> UserAttrSubPacket -> Bool
$c/= :: UserAttrSubPacket -> UserAttrSubPacket -> Bool
== :: UserAttrSubPacket -> UserAttrSubPacket -> Bool
$c== :: UserAttrSubPacket -> UserAttrSubPacket -> Bool
Eq, (forall x. UserAttrSubPacket -> Rep UserAttrSubPacket x)
-> (forall x. Rep UserAttrSubPacket x -> UserAttrSubPacket)
-> Generic UserAttrSubPacket
forall x. Rep UserAttrSubPacket x -> UserAttrSubPacket
forall x. UserAttrSubPacket -> Rep UserAttrSubPacket x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserAttrSubPacket x -> UserAttrSubPacket
$cfrom :: forall x. UserAttrSubPacket -> Rep UserAttrSubPacket x
Generic, Int -> UserAttrSubPacket -> ShowS
[UserAttrSubPacket] -> ShowS
UserAttrSubPacket -> String
(Int -> UserAttrSubPacket -> ShowS)
-> (UserAttrSubPacket -> String)
-> ([UserAttrSubPacket] -> ShowS)
-> Show UserAttrSubPacket
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserAttrSubPacket] -> ShowS
$cshowList :: [UserAttrSubPacket] -> ShowS
show :: UserAttrSubPacket -> String
$cshow :: UserAttrSubPacket -> String
showsPrec :: Int -> UserAttrSubPacket -> ShowS
$cshowsPrec :: Int -> UserAttrSubPacket -> ShowS
Show, Typeable)

instance Hashable UserAttrSubPacket

instance Ord UserAttrSubPacket where
  compare :: UserAttrSubPacket -> UserAttrSubPacket -> Ordering
compare (ImageAttribute h1 :: ImageHeader
h1 d1 :: ByteString
d1) (ImageAttribute h2 :: ImageHeader
h2 d2 :: ByteString
d2) =
    ImageHeader -> ImageHeader -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ImageHeader
h1 ImageHeader
h2 Ordering -> Ordering -> Ordering
forall a. Semigroup a => a -> a -> a
<> ByteString -> ByteString -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ByteString
d1 ByteString
d2
  compare (ImageAttribute _ _) (OtherUASub _ _) = Ordering
LT
  compare (OtherUASub _ _) (ImageAttribute _ _) = Ordering
GT
  compare (OtherUASub t1 :: Word8
t1 b1 :: ByteString
b1) (OtherUASub t2 :: Word8
t2 b2 :: ByteString
b2) = Word8 -> Word8 -> Ordering
forall a. Ord a => a -> a -> Ordering
compare Word8
t1 Word8
t2 Ordering -> Ordering -> Ordering
forall a. Semigroup a => a -> a -> a
<> ByteString -> ByteString -> Ordering
forall a. Ord a => a -> a -> Ordering
compare ByteString
b1 ByteString
b2

instance Pretty UserAttrSubPacket where
  pretty :: UserAttrSubPacket -> Doc ann
pretty (ImageAttribute ih :: ImageHeader
ih d :: ByteString
d) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "image-attribute" Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> ImageHeader -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty ImageHeader
ih Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [Word8] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (ByteString -> [Word8]
BL.unpack ByteString
d)
  pretty (OtherUASub t :: Word8
t bs :: ByteString
bs) =
    String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "unknown attribute type" Doc ann -> Doc ann -> Doc ann
forall a. Semigroup a => a -> a -> a
<> Word8 -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty Word8
t Doc ann -> Doc ann -> Doc ann
forall ann. Doc ann -> Doc ann -> Doc ann
<+> [Word8] -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty (ByteString -> [Word8]
BL.unpack ByteString
bs)

instance A.ToJSON UserAttrSubPacket where
  toJSON :: UserAttrSubPacket -> Value
toJSON (ImageAttribute ih :: ImageHeader
ih d :: ByteString
d) = (ImageHeader, [Word8]) -> Value
forall a. ToJSON a => a -> Value
A.toJSON (ImageHeader
ih, ByteString -> [Word8]
BL.unpack ByteString
d)
  toJSON (OtherUASub t :: Word8
t bs :: ByteString
bs) = (Word8, [Word8]) -> Value
forall a. ToJSON a => a -> Value
A.toJSON (Word8
t, ByteString -> [Word8]
BL.unpack ByteString
bs)

data ECCCurve
  = NISTP256
  | NISTP384
  | NISTP521
  | Curve25519
  deriving (Typeable ECCCurve
Constr
DataType
Typeable ECCCurve =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> ECCCurve -> c ECCCurve)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ECCCurve)
-> (ECCCurve -> Constr)
-> (ECCCurve -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ECCCurve))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ECCCurve))
-> ((forall b. Data b => b -> b) -> ECCCurve -> ECCCurve)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ECCCurve -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ECCCurve -> r)
-> (forall u. (forall d. Data d => d -> u) -> ECCCurve -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ECCCurve -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve)
-> Data ECCCurve
ECCCurve -> Constr
ECCCurve -> DataType
(forall b. Data b => b -> b) -> ECCCurve -> ECCCurve
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ECCCurve -> c ECCCurve
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ECCCurve
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) -> ECCCurve -> u
forall u. (forall d. Data d => d -> u) -> ECCCurve -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ECCCurve -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ECCCurve -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ECCCurve
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ECCCurve -> c ECCCurve
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ECCCurve)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ECCCurve)
$cCurve25519 :: Constr
$cNISTP521 :: Constr
$cNISTP384 :: Constr
$cNISTP256 :: Constr
$tECCCurve :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve
gmapMp :: (forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve
gmapM :: (forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ECCCurve -> m ECCCurve
gmapQi :: Int -> (forall d. Data d => d -> u) -> ECCCurve -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ECCCurve -> u
gmapQ :: (forall d. Data d => d -> u) -> ECCCurve -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ECCCurve -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ECCCurve -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ECCCurve -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ECCCurve -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ECCCurve -> r
gmapT :: (forall b. Data b => b -> b) -> ECCCurve -> ECCCurve
$cgmapT :: (forall b. Data b => b -> b) -> ECCCurve -> ECCCurve
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ECCCurve)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ECCCurve)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ECCCurve)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ECCCurve)
dataTypeOf :: ECCCurve -> DataType
$cdataTypeOf :: ECCCurve -> DataType
toConstr :: ECCCurve -> Constr
$ctoConstr :: ECCCurve -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ECCCurve
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ECCCurve
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ECCCurve -> c ECCCurve
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ECCCurve -> c ECCCurve
$cp1Data :: Typeable ECCCurve
Data, ECCCurve -> ECCCurve -> Bool
(ECCCurve -> ECCCurve -> Bool)
-> (ECCCurve -> ECCCurve -> Bool) -> Eq ECCCurve
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ECCCurve -> ECCCurve -> Bool
$c/= :: ECCCurve -> ECCCurve -> Bool
== :: ECCCurve -> ECCCurve -> Bool
$c== :: ECCCurve -> ECCCurve -> Bool
Eq, (forall x. ECCCurve -> Rep ECCCurve x)
-> (forall x. Rep ECCCurve x -> ECCCurve) -> Generic ECCCurve
forall x. Rep ECCCurve x -> ECCCurve
forall x. ECCCurve -> Rep ECCCurve x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ECCCurve x -> ECCCurve
$cfrom :: forall x. ECCCurve -> Rep ECCCurve x
Generic, Eq ECCCurve
Eq ECCCurve =>
(ECCCurve -> ECCCurve -> Ordering)
-> (ECCCurve -> ECCCurve -> Bool)
-> (ECCCurve -> ECCCurve -> Bool)
-> (ECCCurve -> ECCCurve -> Bool)
-> (ECCCurve -> ECCCurve -> Bool)
-> (ECCCurve -> ECCCurve -> ECCCurve)
-> (ECCCurve -> ECCCurve -> ECCCurve)
-> Ord ECCCurve
ECCCurve -> ECCCurve -> Bool
ECCCurve -> ECCCurve -> Ordering
ECCCurve -> ECCCurve -> ECCCurve
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
min :: ECCCurve -> ECCCurve -> ECCCurve
$cmin :: ECCCurve -> ECCCurve -> ECCCurve
max :: ECCCurve -> ECCCurve -> ECCCurve
$cmax :: ECCCurve -> ECCCurve -> ECCCurve
>= :: ECCCurve -> ECCCurve -> Bool
$c>= :: ECCCurve -> ECCCurve -> Bool
> :: ECCCurve -> ECCCurve -> Bool
$c> :: ECCCurve -> ECCCurve -> Bool
<= :: ECCCurve -> ECCCurve -> Bool
$c<= :: ECCCurve -> ECCCurve -> Bool
< :: ECCCurve -> ECCCurve -> Bool
$c< :: ECCCurve -> ECCCurve -> Bool
compare :: ECCCurve -> ECCCurve -> Ordering
$ccompare :: ECCCurve -> ECCCurve -> Ordering
$cp1Ord :: Eq ECCCurve
Ord, Int -> ECCCurve -> ShowS
[ECCCurve] -> ShowS
ECCCurve -> String
(Int -> ECCCurve -> ShowS)
-> (ECCCurve -> String) -> ([ECCCurve] -> ShowS) -> Show ECCCurve
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ECCCurve] -> ShowS
$cshowList :: [ECCCurve] -> ShowS
show :: ECCCurve -> String
$cshow :: ECCCurve -> String
showsPrec :: Int -> ECCCurve -> ShowS
$cshowsPrec :: Int -> ECCCurve -> ShowS
Show, Typeable)

instance Pretty ECCCurve where
  pretty :: ECCCurve -> Doc ann
pretty NISTP256 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "NIST P-256"
  pretty NISTP384 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "NIST P-384"
  pretty NISTP521 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "NIST P-521"
  pretty Curve25519 = String -> Doc ann
forall a ann. Pretty a => a -> Doc ann
pretty "Curve25519"

instance Hashable ECCCurve

newtype Block a =
  Block
    { Block a -> [a]
unBlock :: [a]
    } -- so we can override cereal instance
  deriving (Int -> Block a -> ShowS
[Block a] -> ShowS
Block a -> String
(Int -> Block a -> ShowS)
-> (Block a -> String) -> ([Block a] -> ShowS) -> Show (Block a)
forall a. Show a => Int -> Block a -> ShowS
forall a. Show a => [Block a] -> ShowS
forall a. Show a => Block a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Block a] -> ShowS
$cshowList :: forall a. Show a => [Block a] -> ShowS
show :: Block a -> String
$cshow :: forall a. Show a => Block a -> String
showsPrec :: Int -> Block a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Block a -> ShowS
Show, Block a -> Block a -> Bool
(Block a -> Block a -> Bool)
-> (Block a -> Block a -> Bool) -> Eq (Block a)
forall a. Eq a => Block a -> Block a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Block a -> Block a -> Bool
$c/= :: forall a. Eq a => Block a -> Block a -> Bool
== :: Block a -> Block a -> Bool
$c== :: forall a. Eq a => Block a -> Block a -> Bool
Eq)