chp-spec-1.0.0: A mirror implementation of chp that generates a specification of the program



This module is a near-copy of the Test.LazySmallCheck module from the lazysmallcheck package on Hackage. It was written by Matthew Naylor and Fredrik Lindblad. I have modified it to add the fuzz function that is used by chp-spec internally, but to write that function I needed access to more internals than the original Test.LazySmallCheck exposed, hence I had to make a copy of the module. Unfortunately, this means that the Serial type-class here is a different type-class (despite being identical in behaviour and API) from the original lazysmallcheck package. The modified module is exposed in case you need to supply any of your own instances for Serial. For more explanation of how Lazy SmallCheck is used in this library for modelling IO actions, see this blog post:


class Serial a whereSource


series :: Series aSource


Serial Bool 
Serial Char 
Serial Double 
Serial Float 
Serial Int 
Serial Integer 
Serial () 
Serial a => Serial [a] 
Serial a => Serial (Maybe a) 
(Serial a, Serial b) => Serial (Either a b) 
(Serial a, Serial b) => Serial (a, b) 
(Serial a, Serial b, Serial c) => Serial (a, b, c) 
(Serial a, Serial b, Serial c, Serial d) => Serial (a, b, c, d) 
(Serial a, Serial b, Serial c, Serial d, Serial e) => Serial (a, b, c, d, e) 

type Series a = Int -> Cons aSource

data Cons a Source

cons :: a -> Series aSource

(><) :: Series (a -> b) -> Series a -> Series bSource

drawnFrom :: [a] -> Cons aSource

cons1 :: Serial a => (a -> b) -> Series bSource

cons2 :: (Serial a, Serial b) => (a -> b -> c) -> Series cSource

cons3 :: (Serial a, Serial b, Serial c) => (a -> b -> c -> d) -> Series dSource

cons4 :: (Serial a, Serial b, Serial c, Serial d) => (a -> b -> c -> d -> e) -> Series eSource

cons5 :: (Serial a, Serial b, Serial c, Serial d, Serial e) => (a -> b -> c -> d -> e -> f) -> Series fSource

fuzz :: Serial a => (a -> StateT s IO b) -> StateT s IO ([b], Bool)Source