This module defines the interface of properties that can be checked with the CurryCheck tool, an automatic property-based test tool based on the EasyCheck library. The ideas behind EasyCheck are described in this paper. CurryCheck automatically tests properties defined with this library. CurryCheck supports the definition of unit tests (also for I/O operations) and property tests parameterized over some arguments. CurryCheck is described in more detail in this paper.
Basically, this module is a stub clone of the EasyCheck library which contains only the interface of the operations used to specify properties. Hence, this library does not import any other library. This supports the definition of properties in any other module (execept for the prelude).
Author: Sebastian Fischer (with extensions by Michael Hanus)
Version: January 2019
| returns
                  :: (Eq a, Show a) => IO a -> a -> PropIOThe property returns a xis satisfied if the execution of the
I/O actionareturns the valuex. | 
| sameReturns
                  :: (Eq a, Show a) => IO a -> IO a -> PropIOThe property sameReturns a1 a2is satisfied if the execution of the
I/O actionsa1anda2return identical values. | 
| toError
                  ::  a -> PropIOThe property toError ais satisfied if the evaluation of the argument
to normal form yields an exception. | 
| toIOError
                  ::  IO a -> PropIOThe property toIOError ais satisfied if the execution of the
I/O actionacauses an exception. | 
| (-=-)
                  :: (Eq a, Show a) => a -> a -> PropThe property x -=- yis satisfied ifxandyhave deterministic
values that are equal. | 
| (<~>)
                  :: (Eq a, Show a) => a -> a -> PropThe property x <~> yis satisfied if the sets of the values ofxandyare equal. | 
| (~>)
                  :: (Eq a, Show a) => a -> a -> PropThe property x ~> yis satisfied ifxevaluates to every value ofy. | 
| (<~)
                  :: (Eq a, Show a) => a -> a -> PropThe property x <~ yis satisfied ifyevaluates to every value ofx. | 
| (<~~>)
                  :: (Eq a, Show a) => a -> a -> PropThe property x <~~> yis satisfied if the multisets of the values ofxandyare equal. | 
| (==>)
                  ::  Bool -> Prop -> PropA conditional property is tested if the condition evaluates to True. | 
| solutionOf
                  ::  (a -> Bool) -> asolutionOf preturns (non-deterministically) a solution
of predicatep. | 
| is
                  :: Show a => a -> (a -> Bool) -> PropThe property is x pis satisfied ifxhas a deterministic value
which satisfiesp. | 
| isAlways
                  :: Show a => a -> (a -> Bool) -> PropThe property isAlways x pis satisfied if all values ofxsatisfyp. | 
| isEventually
                  :: Show a => a -> (a -> Bool) -> PropThe property isEventually x pis satisfied if some value ofxsatisfiesp. | 
| uniquely
                  ::  Bool -> PropThe property uniquely xis satisfied ifxhas a deterministic value
which is true. | 
| always
                  ::  Bool -> PropThe property always xis satisfied if all values ofxare true. | 
| eventually
                  ::  Bool -> PropThe property eventually xis satisfied if some value ofxis true. | 
| failing
                  :: Show a => a -> PropThe property failing xis satisfied ifxhas no value. | 
| successful
                  :: Show a => a -> PropThe property successful xis satisfied ifxhas at least one value. | 
| deterministic
                  :: Show a => a -> PropThe property deterministic xis satisfied ifxhas exactly one value. | 
| (#)
                  :: (Eq a, Show a) => a -> Int -> PropThe property x # nis satisfied ifxhasnvalues. | 
| (#<)
                  :: (Eq a, Show a) => a -> Int -> PropThe property x #< nis satisfied ifxhas less thannvalues. | 
| (#>)
                  :: (Eq a, Show a) => a -> Int -> PropThe property x #> nis satisfied ifxhas more thannvalues. | 
| for
                  :: Show a => a -> (a -> Prop) -> PropThe property for x pis satisfied if all valuesyofxsatisfy propertyp y. | 
| forAll
                  :: Show a => [a] -> (a -> Prop) -> PropThe property forAll xs pis satisfied if all valuesxof the listxssatisfy propertyp x. | 
| (<=>)
                  ::  a -> a -> PropThe property f <=> gis satisfied iffandgare equivalent
operations, i.e., they can be replaced in any context without changing
the computed results. | 
| label
                  ::  String -> Prop -> PropAssign a label to a property. | 
| classify
                  ::  Bool -> String -> Prop -> PropAssign a label to a property if the first argument is True. | 
| trivial
                  ::  Bool -> Prop -> PropAssign the label "trivial" to a property if the first argument is True. | 
| collect
                  :: Show a => a -> Prop -> PropAssign a label showing the given argument to a property. | 
| collectAs
                  :: Show a => String -> a -> Prop -> PropAssign a label showing a given name and the given argument to a property. | 
| valuesOf
                  ::  a -> [a]Computes the list of all values of the given argument according to a given strategy (here: randomized diagonalization of levels with flattening). | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  
 | 
| 
                      The property  | 
| 
                      The property  | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  
 | 
| 
                      A conditional property is tested if the condition evaluates to  
 | 
| 
                       
                       | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  
 | 
| 
                      The property  | 
| 
                       
                      The property  | 
| 
                       
                      The property  | 
| 
                       
                      The property  | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  
 | 
| 
                       
                      The property  | 
| 
                       
                      The property  | 
| 
                      The property  
 | 
| 
                       Assign a label to a property. All labeled tests are counted and shown at the end. | 
| 
                       
                      Assign a label to a property if the first argument is  multIsComm x y = classify (x<0 || y<0) "Negative" $ x*y -=- y*x | 
| 
                       
                      Assign the label "trivial" to a property if the first argument is  
 | 
| 
                       Assign a label showing the given argument to a property. All labeled tests are counted and shown at the end. | 
| 
                       Assign a label showing a given name and the given argument to a property. All labeled tests are counted and shown at the end. | 
| 
                       Computes the list of all values of the given argument according to a given strategy (here: randomized diagonalization of levels with flattening). |