| 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 → ([Prereq], [Requirement])
- requiredIf ∷ Bool → Requirement
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
A prerequisite
If any prereq is Blocked, then the ultimate observation must be False.
See Requirement.
Instances
| Eq Prereq Source # | |
| Show 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
| Eq Requirement Source # | |
Defined in Test.Util.BoolProps | |
| Show Requirement Source # | |
Defined in Test.Util.BoolProps Methods showsPrec ∷ Int → Requirement → ShowS # show ∷ Requirement → String # showList ∷ [Requirement] → ShowS # | |
| 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 → ([Prereq], [Requirement]) Source #
requiredIf ∷ Bool → Requirement Source #