| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Polysemy.Law
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 Laws into QuickCheck-able Propertys.
Constructors
| Law | |
| Fields 
 | |
| LawIO | |
| Fields 
 | |
class MakeLaw e r where Source #
A typeclass that provides the smart constructor mkLaw.
Methods
mkLaw :: (Eq a, Show a, Citizen res (Sem (e ': r) a)) => String -> res -> String -> res -> Law e r Source #
A smart constructor for building Laws.
class Citizen r a | r -> a where Source #
Associates the name r with the eventual type a. For example,
 Citizen (String -> Bool) BoolBools by calling
 the given function with arbitrary Strings.
Methods
getCitizen :: r -> r -> Gen ([String], (a, a)) Source #
Generate two as via two rs. 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 Methods 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