quickspec-0.9.6: Equational laws for free!

Safe HaskellNone

Test.QuickSpec.Prelude

Description

The "prelude": a standard signature containing useful functions like ++, which can be used as background theory.

Synopsis

Documentation

newtype A Source

Just a type. You can instantiate your polymorphic functions at this type to include them in a signature.

Constructors

A Int 

newtype B Source

Constructors

B Int 

newtype C Source

Constructors

C Int 

data Two Source

A type with two elements. Use this instead of A if testing doesn't work well because the domain of A is too large.

Constructors

One 
Two 

bools :: SigSource

A signature containing boolean functions: (||), (&&), not, True, False.

arith :: forall a. (Typeable a, Ord a, Num a, Arbitrary a) => a -> SigSource

A signature containing arithmetic operations: 0, 1, (+), (*). Instantiate it with e.g. arith (undefined :: Int).

lists :: forall a. (Typeable a, Ord a, Arbitrary a) => a -> SigSource

A signature containing list operations: [], (:), head, tail, (++). Instantiate it with e.g. lists (undefined :: A).

funs :: forall a. (Typeable a, Ord a, Arbitrary a, CoArbitrary a) => a -> SigSource

A signature containing higher-order functions: (.), id, and some function variables. Useful for testing map.

prelude :: (Typeable a, Ord a, Arbitrary a) => a -> SigSource

The QuickSpec prelude. Contains boolean, arithmetic and list functions, and some variables. Instantiate it as e.g. prelude (undefined :: A). For more precise control over what gets included, see bools, arith, lists, funs and without.