Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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.
Nothing
collectReqs ∷ a → ([Prereq], [Requirement]) Source #
default collectReqs ∷ (Generic a, GCollectReqs (Rep a)) ⇒ a → ([Prereq], [Requirement]) Source #
Instances
CollectReqs Prereq Source # | |
Defined in Test.Util.BoolProps collectReqs ∷ Prereq → ([Prereq], [Requirement]) Source # | |
CollectReqs Requirement Source # | |
Defined in Test.Util.BoolProps collectReqs ∷ Requirement → ([Prereq], [Requirement]) Source # | |
CollectReqs Bool Source # | |
Defined in Test.Util.BoolProps collectReqs ∷ Bool → ([Prereq], [Requirement]) Source # | |
CollectReqs a ⇒ CollectReqs [a] Source # | |
Defined in Test.Util.BoolProps collectReqs ∷ [a] → ([Prereq], [Requirement]) Source # | |
(CollectReqs a, CollectReqs b) ⇒ CollectReqs (a, b) Source # | |
Defined in Test.Util.BoolProps collectReqs ∷ (a, b) → ([Prereq], [Requirement]) Source # | |
(CollectReqs a, CollectReqs b, CollectReqs c) ⇒ CollectReqs (a, b, c) Source # | |
Defined in Test.Util.BoolProps collectReqs ∷ (a, b, c) → ([Prereq], [Requirement]) Source # | |
(CollectReqs a, CollectReqs b, CollectReqs c, CollectReqs d) ⇒ CollectReqs (a, b, c, d) Source # | |
Defined in Test.Util.BoolProps collectReqs ∷ (a, b, c, d) → ([Prereq], [Requirement]) Source # |
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 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 showsPrec ∷ Int → Requirement → ShowS # show ∷ Requirement → String # showList ∷ [Requirement] → ShowS # | |
Eq Requirement Source # | |
Defined in Test.Util.BoolProps (==) ∷ Requirement → Requirement → Bool # (/=) ∷ Requirement → Requirement → Bool # | |
CollectReqs Requirement Source # | |
Defined in Test.Util.BoolProps 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 #