cardano-ledger-test-9.9.9.9: Testing harness, tests and benchmarks for Shelley style cardano ledgers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Constrained.Env

Description

Provides variables (V era t), and mappings of them to objects of type t

Synopsis

Documentation

data V era t where Source #

A proto variable. May or may not contain a Lens (encoded as Access)

Constructors

VRawEra era ⇒ StringRep era t → IntAccess era s t → V era t 

Bundled Patterns

pattern V ∷ () ⇒ Era era ⇒ StringRep era t → Access era s t → V era t

We make hashing of V cheap by memoizing most of the hash computation in in the 3rd argument of VRaw, we provide this pattern to hide this from every other use.

Instances

Instances details
Show (V era t) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

showsPrecIntV era t → ShowS Source #

showV era t → String Source #

showList ∷ [V era t] → ShowS Source #

Eq (V era t) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

(==)V era t → V era t → Bool Source #

(/=)V era t → V era t → Bool Source #

Hashable (V era t) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

hashWithSaltIntV era t → Int Source #

hashV era t → Int Source #

pVProof era → StringRep era t → Access era s t → V era t Source #

Construct a V, dsicharging the (Era era) constraint, using the Proof

data Field era s t where Source #

Fields are like V, except they expose the type of the Lens

Constructors

FieldEra era ⇒ StringRep era t → Rep era s → Lens' s t → Field era s t 
FConstRep era t → t → Rep era s → Lens' s t → Field era s t 

Instances

Instances details
Show (Field era s t) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

showsPrecIntField era s t → ShowS Source #

showField era s t → String Source #

showList ∷ [Field era s t] → ShowS Source #

data AnyF era s where Source #

Hide the type of t in a Field.

Constructors

AnyFField era s t → AnyF era s 

Instances

Instances details
Show (AnyF era s) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

showsPrecIntAnyF era s → ShowS Source #

showAnyF era s → String Source #

showList ∷ [AnyF era s] → ShowS Source #

vToFieldEra era ⇒ Rep era s → V era t → Typed (Field era s t) Source #

fieldToVEra era ⇒ Field era s t → Typed (V era t) Source #

newtype Env era Source #

Constructors

Env (Map String (Payload era)) 

Instances

Instances details
Show (Env era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

showsPrecIntEnv era → ShowS Source #

showEnv era → String Source #

showList ∷ [Env era] → ShowS Source #

data Payload era where Source #

Constructors

PayloadRep era t → t → Access era s t → Payload era 

findVarV era t → Env era → Typed t Source #

storeVarV era t → t → Env era → Env era Source #

findNameName era → Env era → Maybe (Payload era) Source #

Untyped version of findVar.

storeNameName era → Payload era → Env era → Env era Source #

Untyped version of storeVar.

restrictEnv ∷ [Name era] → Env era → Env era Source #

Drop any names that are not in the given list from an environment.

data P era where Source #

Constructors

PV era t → t → P era 

Instances

Instances details
Show (P era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

showsPrecIntP era → ShowS Source #

showP era → String Source #

showList ∷ [P era] → ShowS Source #

bulkStore ∷ [P era] → Env era → Env era Source #

data Name era where Source #

An existentially quantified (V era t), hiding the t The Hashable instance is inherited from V

Constructors

NameV era t → Name era 

Instances

Instances details
Show (Name era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

showsPrecIntName era → ShowS Source #

showName era → String Source #

showList ∷ [Name era] → ShowS Source #

Eq (Name era) Source #

Does not satisfy extensionality

Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

(==)Name era → Name era → Bool Source #

(/=)Name era → Name era → Bool Source #

Ord (Name era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

compareName era → Name era → Ordering Source #

(<)Name era → Name era → Bool Source #

(<=)Name era → Name era → Bool Source #

(>)Name era → Name era → Bool Source #

(>=)Name era → Name era → Bool Source #

maxName era → Name era → Name era Source #

minName era → Name era → Name era Source #

Era era ⇒ Hashable (Name era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Constrained.Env

Methods

hashWithSaltIntName era → Int Source #

hashName era → Int Source #

data Access era s t where Source #

Constructors

YesRep era s → Lens' s t → Access era s t 
NoAccess era s t 

otherFromEnv ∷ [String] → Env era → [String] Source #

sameNameV era t → V era s → Maybe (t :~: s) Source #

Orphan instances

Eq (Proof e) Source # 
Instance details

Methods

(==)Proof e → Proof e → Bool Source #

(/=)Proof e → Proof e → Bool Source #

Hashable (Shape a) Source #

Inheriting the Hashable instancefor types that have Shapes, Works for types whose Shaped instances don't mention Esc, Like Evidence, Proof, Rep But we CANNOT use this strategy for (V era t) since its's Shape instance use Esc

Instance details

Methods

hashWithSaltIntShape a → Int Source #

hashShape a → Int Source #

Hashable (Proof e) Source # 
Instance details

Methods

hashWithSaltIntProof e → Int Source #

hashProof e → Int Source #

Eq (Rep e t) Source # 
Instance details

Methods

(==)Rep e t → Rep e t → Bool Source #

(/=)Rep e t → Rep e t → Bool Source #

Hashable (Rep e t) Source # 
Instance details

Methods

hashWithSaltIntRep e t → Int Source #

hashRep e t → Int Source #