Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Law e r where
- runLaw :: InterpreterFor e r -> Law e r -> Property
- class MakeLaw e r where
- class Citizen r a | r -> a where
- getCitizen :: r -> r -> Gen ([String], (a, a))
- printf :: String -> [String] -> String
- module Test.QuickCheck
Documentation
A law that effect e
must satisfy whenever it is in environment r
. You
can use runLaw
to transform these Law
s into QuickCheck-able Property
s.
Law | |
| |
LawIO | |
|
class MakeLaw e r where Source #
A typeclass that provides the smart constructor mkLaw
.
mkLaw :: (Eq a, Show a, Citizen res (Sem (e ': r) a)) => String -> res -> String -> res -> Law e r Source #
A smart constructor for building Law
s.
class Citizen r a | r -> a where Source #
Associates the name r
with the eventual type a
. For example,
can produce arbitrary Citizen
(String -> Bool) BoolBool
s by calling
the given function with arbitrary String
s.
getCitizen :: r -> r -> Gen ([String], (a, a)) Source #
Generate two a
s via two r
s. Additionally, produce a list of strings
corresponding to any arbitrary arguments we needed to build.
Instances
(Arbitrary a, Show a, Citizen b r) => Citizen (a -> b) r Source # | |
Defined in Polysemy.Law getCitizen :: (a -> b) -> (a -> b) -> Gen ([String], (r, r)) Source # | |
Citizen (Sem r a -> b) (Sem r a -> b) Source # | |
Defined in Polysemy.Law | |
Citizen (Sem r a) (Sem r a) Source # | |
Defined in Polysemy.Law |
printf :: String -> [String] -> String Source #
A bare-boned implementation of printf. This function will replace tokens
of the form "%n"
in the first string with args !! n
.
This will only work for indexes up to 9.
For example:
>>>
printf "hello %1 %2% %3 %1" ["world", "50"]
"hello world 50% %3 world"
module Test.QuickCheck