ouroboros-consensus-0.21.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Util.BoolProps

Synopsis

Documentation

class CollectReqs a where Source #

Collect all of the Prereqs and Requirements from a composite type

The default definition uses GHC.Generics to automatically handle algebraic types containing only Prereq, Requirement, Bool, lists, and small tuples.

Note that collectReqs ignores Bools. It's up to the user to interpret Bools as either disjunctive/conjunctive/etc observations.

Minimal complete definition

Nothing

Methods

collectReqs ∷ a → ([Prereq], [Requirement]) Source #

default collectReqs ∷ (Generic a, GCollectReqs (Rep a)) ⇒ a → ([Prereq], [Requirement]) Source #

Instances

Instances details
CollectReqs Prereq Source # 
Instance details

Defined in Test.Util.BoolProps

CollectReqs Requirement Source # 
Instance details

Defined in Test.Util.BoolProps

CollectReqs Bool Source # 
Instance details

Defined in Test.Util.BoolProps

Methods

collectReqsBool → ([Prereq], [Requirement]) Source #

CollectReqs a ⇒ CollectReqs [a] Source # 
Instance details

Defined in Test.Util.BoolProps

Methods

collectReqs ∷ [a] → ([Prereq], [Requirement]) Source #

(CollectReqs a, CollectReqs b) ⇒ CollectReqs (a, b) Source # 
Instance details

Defined in Test.Util.BoolProps

Methods

collectReqs ∷ (a, b) → ([Prereq], [Requirement]) Source #

(CollectReqs a, CollectReqs b, CollectReqs c) ⇒ CollectReqs (a, b, c) Source # 
Instance details

Defined in Test.Util.BoolProps

Methods

collectReqs ∷ (a, b, c) → ([Prereq], [Requirement]) Source #

(CollectReqs a, CollectReqs b, CollectReqs c, CollectReqs d) ⇒ CollectReqs (a, b, c, d) Source # 
Instance details

Defined in Test.Util.BoolProps

Methods

collectReqs ∷ (a, b, c, d) → ([Prereq], [Requirement]) Source #

data Prereq Source #

A prerequisite

If any prereq is Blocked, then the ultimate observation must be False.

See Requirement.

Constructors

Blocked 
Enabled 

Instances

Instances details
Show Prereq Source # 
Instance details

Defined in Test.Util.BoolProps

Methods

showsPrecIntPrereqShowS #

showPrereqString #

showList ∷ [Prereq] → ShowS #

Eq Prereq Source # 
Instance details

Defined in Test.Util.BoolProps

Methods

(==)PrereqPrereqBool #

(/=)PrereqPrereqBool #

CollectReqs Prereq Source # 
Instance details

Defined in Test.Util.BoolProps

data Requirement Source #

A requirement

If all prereqs are Enabled and all reqs are Required then the ultimate observation must be True.

Constructors

Optional 
Required 

Instances

Instances details
Show Requirement Source # 
Instance details

Defined in Test.Util.BoolProps

Eq Requirement Source # 
Instance details

Defined in Test.Util.BoolProps

CollectReqs Requirement Source # 
Instance details

Defined in Test.Util.BoolProps

checkReqsCollectReqs a ⇒ a → Maybe Bool Source #

Via CollectReqs, check if the ultimate observation has a required value

gCollectReqs ∷ GCollectReqs rep ⇒ rep (x ∷ Type) → ([Prereq], [Requirement]) Source #