Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test.QuickCheck.Literal
Description
Defines newtypes for strings and integers that can be used to generate
constants. The concrete value of the constant is encoded in the type, e.g.,
'StringConst "hi!"' will always generate string "hi!" using arbitrary.
It is expected the values will be coerced to the underlying data type before
use using coerce
or fromConst
.
Converting to IntConst
or StrConst
using Coercible
is undefined
behaviour unless the actual value matches the value in the type.
Documentation
newtype IntConst (n :: Nat) (i :: Type) #
The data constructor should not be used, can be only created by arbitrary
or def
Constructors
IntConst i |
Instances
(KnownNat n, Integral i) => Arbitrary (IntConst n i) # | Generates the single value encoded in the type, does not shrink. |
(KnownNat n, Integral i, Show i) => Show (IntConst n i) # | |
(KnownNat n, Integral i) => Default (IntConst n i) # | |
Defined in Test.QuickCheck.Literal | |
(KnownNat n, Integral i) => Eq (IntConst n i) # |
|
(KnownNat n, Integral i) => FromConst (IntConst n i) # | |
type ConstRep (IntConst n i) # | |
Defined in Test.QuickCheck.Literal |
newtype StrConst (sym :: Symbol) (str :: Type) #
The data constructor should not be used, can be only created by arbitrary
or def
Constructors
StrConst str |
Instances
(KnownSymbol sym, IsString str) => Arbitrary (StrConst sym str) # | Generates the single value encoded in the type, does not shrink. |
(KnownSymbol sym, IsString str, Show str) => Show (StrConst sym str) # | |
(KnownSymbol sym, IsString str) => Default (StrConst sym str) # | |
Defined in Test.QuickCheck.Literal | |
(KnownSymbol sym, IsString str) => Eq (StrConst sym str) # |
|
(KnownSymbol sym, IsString str) => FromConst (StrConst sym str) # | |
type ConstRep (StrConst sym str) # | |
Defined in Test.QuickCheck.Literal |
type StringConst (sym :: Symbol) = StrConst sym String #