PréludeChargé par défaut — aucun import nécessaire.
Arbitrary — default generators for property-based testing
Synopsis
interface Arbitrary a where
arbitrary : Gen a
A type with a canonical Gen (a pure generator with integrated shrinking, see Core.Gen). oppi test resolves arbitrary at each quantified variable's type, runs it to produce trial values, and — on a falsified property — uses its shrink tree to report a minimal counterexample.
When writing an instance, build it with the generator combinators mapGen/pureGen/bindGen rather than map/pure/>>=.
Instances : Bool,
Char,
Int,
Int16,
Int32,
Int64,
Int8,
Json,
Nat,
Rational,
Regex,
String,
Word16,
Word32,
Word64,
Word8
arbitraryListN : Arbitrary a => Int -> Gen (List a)
gen : Arbitrary a => Int -> a
Convenience bridge: a single generated value from a seed (size fixed at 30). Lets seed-threading callers (and the current property runner) draw a value without touching the Gen/shrink-tree machinery directly.