ouroboros-consensus-test-0.1.0.0: Tests of the consensus layer
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 Bool Source # 
Instance details

Defined in Test.Util.BoolProps

Methods

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

CollectReqs Requirement Source # 
Instance details

Defined in Test.Util.BoolProps

CollectReqs Prereq Source # 
Instance details

Defined in Test.Util.BoolProps

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
Eq Prereq Source # 
Instance details

Defined in Test.Util.BoolProps

Methods

(==)PrereqPrereqBool Source #

(/=)PrereqPrereqBool Source #

Show Prereq Source # 
Instance details

Defined in Test.Util.BoolProps

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
Eq Requirement Source # 
Instance details

Defined in Test.Util.BoolProps

Show 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 #