Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test.Util.BoolProps
Synopsis
- class CollectReqs a where
- collectReqs ∷ a → ([Prereq], [Requirement])
- data Prereq
- data Requirement
- checkReqs ∷ CollectReqs a ⇒ a → Maybe Bool
- enabledIf ∷ Bool → Prereq
- gCollectReqs ∷ GCollectReqs rep ⇒ rep (x ∷ Type) → ([Prereq], [Requirement])
- requiredIf ∷ Bool → Requirement
Documentation
class CollectReqs a where Source #
Collect all of the Prereq
s and Requirement
s 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 Bool
s. It's up to the user to interpret
Bool
s 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
A prerequisite
If any prereq is Blocked
, then the ultimate observation must be False
.
See Requirement
.
Instances
Show Prereq Source # | |
Eq Prereq Source # | |
CollectReqs Prereq Source # | |
Defined in Test.Util.BoolProps Methods collectReqs ∷ Prereq → ([Prereq], [Requirement]) Source # |
data Requirement Source #
A requirement
If all prereqs are Enabled
and all reqs are Required
then the ultimate
observation must be True
.
Instances
Show Requirement Source # | |
Defined in Test.Util.BoolProps Methods showsPrec ∷ Int → Requirement → ShowS # show ∷ Requirement → String # showList ∷ [Requirement] → ShowS # | |
Eq Requirement Source # | |
Defined in Test.Util.BoolProps | |
CollectReqs Requirement Source # | |
Defined in Test.Util.BoolProps Methods collectReqs ∷ Requirement → ([Prereq], [Requirement]) Source # |
checkReqs ∷ CollectReqs 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 #
requiredIf ∷ Bool → Requirement Source #