Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test.Falsify.GenDefault
Description
This module defines something similar to QuickCheck's Arbitrary class along with
some DerivingVia helpers. Our version, GenDefault
, allows one to choose between
sets of default generators with a user-defined tag. See Std
for
the standard tag with a few useful instances.
Synopsis
- class GenDefault tag a where
- genDefault :: Proxy tag -> Gen a
- newtype ViaTag tag' a = ViaTag {
- unViaTag :: a
- newtype ViaIntegral a = ViaIntegral {
- unViaIntegral :: a
- newtype ViaEnum a = ViaEnum {
- unViaEnum :: a
- newtype ViaList l (mn :: Nat) (mx :: Nat) = ViaList {
- unViaList :: l
- newtype ViaString s (mn :: Nat) (mx :: Nat) = ViaString {
- unViaString :: s
- newtype ViaGeneric tag a = ViaGeneric {
- unViaGeneric :: a
Documentation
class GenDefault tag a where Source #
Methods
genDefault :: Proxy tag -> Gen a Source #
Default generator for a
The type-level tag
allows types a
to have multiple defaults.
Instances
newtype ViaTag tag' a Source #
DerivingVia wrapper for types with default instances under other tags
Instances
GenDefault tag' a => GenDefault tag (ViaTag tag' a) Source # | |
Defined in Test.Falsify.GenDefault |
newtype ViaIntegral a Source #
DerivingVia wrapper for Integral types
Constructors
ViaIntegral | |
Fields
|
Instances
(Integral a, FiniteBits a, Bounded a) => GenDefault tag (ViaIntegral a) Source # | |
Defined in Test.Falsify.GenDefault Methods genDefault :: Proxy tag -> Gen (ViaIntegral a) Source # |
DerivingVia wrapper for Enum types
Instances
(Enum a, Bounded a) => GenDefault tag (ViaEnum a) Source # | |
Defined in Test.Falsify.GenDefault |
newtype ViaList l (mn :: Nat) (mx :: Nat) Source #
DerivingVia wrapper for FromList types
Instances
(IsList l, GenDefault tag (Item l), KnownNat mn, KnownNat mx) => GenDefault tag (ViaList l mn mx) Source # | |
Defined in Test.Falsify.GenDefault |
newtype ViaString s (mn :: Nat) (mx :: Nat) Source #
DerivingVia wrapper for FromString types
Constructors
ViaString | |
Fields
|
Instances
(IsString s, GenDefault tag Char, KnownNat mn, KnownNat mx) => GenDefault tag (ViaString s mn mx) Source # | |
Defined in Test.Falsify.GenDefault |
newtype ViaGeneric tag a Source #
DerivingVia wrapper for Generic types
Constructors
ViaGeneric | |
Fields
|
Instances
(Generic t, GGenDefault tag (Rep t)) => GenDefault tag (ViaGeneric tag t) Source # | |
Defined in Test.Falsify.GenDefault Methods genDefault :: Proxy tag -> Gen (ViaGeneric tag t) Source # |