Test.StrongCheck.Perturb
- Package
- purescript-strongcheckDEPRECATED
- Repository
- purescript-contrib/purescript-strongcheck
#Perturb Source
class Perturb a where
The class for things which can be perturbed.
Laws:
forall a, 0 >= n <= 1:
((>=) n) <<< dist a <$> (perturb n a) must be an infinite generator of true
values.
Members
Instances
#PerturberRec Source
type PerturberRec a = { dims :: a -> Number, dist :: a -> a -> Number, perturb :: Number -> a -> Gen a }
#perturberProduct Source
perturberProduct :: forall b a. Perturber a -> Perturber b -> Perturber (Tuple a b)
Combines two perturbers to produce a perturber of the product
#(</\>) Source
Operator alias for Test.StrongCheck.Perturb.perturberProduct (right-associative / precedence 6)
#perturberSum Source
perturberSum :: forall b a. Perturber a -> Perturber b -> Perturber (Either a b)
Combines two perturbers to produce a perturber of the sum
#(<\/>) Source
Operator alias for Test.StrongCheck.Perturb.perturberSum (right-associative / precedence 6)
#boundedInt Source
boundedInt :: Int -> Int -> Perturber Int
Creates a perturber for integers that fall within the specified range.
#nonPerturber Source
nonPerturber :: forall a. Perturber a
Creates a perturber that perturbs nothing.
#searchIn' Source
searchIn' :: forall a. Perturb a => Attempts -> Int -> (a -> Boolean) -> a -> Gen a
Given one example, searches for other examples that satisfy a provided boolean predicate.
The search operates out-to-in, in an attempt to find examples that are as far removed from the provided example as possible. The sampling size parameter determines how many samples to take at every level of searching, while the attempts parameter determines how many levels.
#unPerturber Source
unPerturber :: forall a. Perturber a -> PerturberRec a
- Modules
- Test.
StrongCheck - Test.
StrongCheck. Arbitrary - Test.
StrongCheck. Data. AlphaNumString - Test.
StrongCheck. Data. ApproxNumber - Test.
StrongCheck. Data. ArbBoundedEnum - Test.
StrongCheck. Data. ArbDateTime - Test.
StrongCheck. Data. Negative - Test.
StrongCheck. Data. NonZero - Test.
StrongCheck. Data. Positive - Test.
StrongCheck. Data. Signum - Test.
StrongCheck. Gen - Test.
StrongCheck. LCG - Test.
StrongCheck. Landscape - Test.
StrongCheck. Perturb