leancheck-instances: Common LeanCheck instances

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Listable instances for types provided by the Haskell Platform.

The current objective is to include all types supported by quickcheck-instances: https://hackage.haskell.org/package/quickcheck-instances


[Skip to ReadMe]

Properties

Versions0.0.1, 0.0.2, 0.0.2, 0.0.3
Change logchangelog.md
Dependenciesarray, base (==4.*), bytestring, containers, leancheck (>=0.7.7), nats, text, time [details]
LicenseBSD-3-Clause
AuthorRudy Matela <rudy@matela.com.br>
MaintainerRudy Matela <rudy@matela.com.br>
CategoryTesting
Home pagehttps://github.com/rudymatela/leancheck-instances#readme
Source repositoryhead: git clone https://github.com/rudymatela/leancheck-instances
this: git clone https://github.com/rudymatela/leancheck-instances(tag v0.0.2)
UploadedThu Jan 17 02:02:41 UTC 2019 by rudymatela

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for leancheck-instances-0.0.2

[back to package description]

LeanCheck

leancheck-instances&#39;s Build Status leancheck-instances on Hackage leancheck-instances on Stackage LTS leancheck-instances on Stackage Nightly

This package extends LeanCheck by providing Listable instances for common types provided by the Haskell Platform.

This package is to LeanCheck what quickcheck-instances is to QuickCheck. The current objective is to include all types supported by quickcheck-instances.

Installing

To install the latest leancheck-instances version from Hackage, just run:

$ cabal update
$ cabal install leancheck-instances

Examples

Importing the library:

> import Test.LeanCheck
> import Test.LeanCheck.Instances

Checking properties of Text:

> import qualified Data.Text as T
> check $ \t -> T.reverse (T.reverse t) == t
+++ OK, passed 200 tests.
> check $ \t -> T.reverse t == t
*** Failed! Falsifiable (after 6 tests):
"a "

Enumerating maps:

> import Data.Map
> list :: [Map Bool Bool]
[ fromList []
, fromList [(False,False)]
, fromList [(False,True)]
, fromList [(True,False)]
, fromList [(True,True)]
, fromList [(False,False),(True,False)]
, fromList [(False,False),(True,True)]
, fromList [(False,True),(True,False)]
, fromList [(False,True),(True,True)]
]
> take 7 $ list :: [Map Int Int]
[ fromList []
, fromList [(0,0)]
, fromList [(0,1)]
, fromList [(1,0)]
, fromList [(0,-1)]
, fromList [(1,1)]
, fromList [(0,0),(1,0)]
]

Further reading / see also