Safe Haskell | None |
---|---|
Language | Haskell2010 |
LeanCheck is a simple enumerative property-based testing library.
This is an experimental module for deriving Listable
instances.
Needs GHC and Template Haskell (tested on GHC 7.4, 7.6, 7.8, 7.10 and 8.0).
If LeanCheck does not compile under later GHCs, this module is probably the culprit.
- deriveListable :: Name -> DecsQ
Documentation
deriveListable :: Name -> DecsQ Source #
Derives a Listable
instance for a given type Name
.
Consider the following Stack
datatype:
data Stack a = Stack a (Stack a) | Empty
Writing
deriveListable ''Stack
will automatically derive the following Listable
instance:
instance Listable a => Listable (Stack a) where tiers = cons2 Stack \/ cons0 Empty
Needs the TemplateHaskell
extension.