[Haskell-cafe] [Haskell] [ANN] GenCheck - a generalized property-based testing framework

Jacques Carette carette at mcmaster.ca
Sat Jun 23 18:00:44 CEST 2012

On 12-06-23 04:38 AM, José Pedro Magalhães wrote:
> On Tue, Jun 19, 2012 at 4:04 PM, Jacques Carette <carette at mcmaster.ca 
> <mailto:carette at mcmaster.ca>> wrote:
>     User beware: this is gencheck-0.1, there are still a few rough
>     edges.  We plan to add a Template Haskell feature to this which
>     should make deriving enumerators automatic for version 0.2.
> Can you provide me a quick pointer into what methods need to be 
> generated automatically?

Sure.  Given a data definition such as
data Zipper a = Zip ![a] ![a] deriving (Eq,Show)
(where the strictness annotations are not relevant), one would want to 
automatically generate

instance Enumerated Zipper where
    enumeration = eMemoize $  eProd Zip (eList A) (eList A)

and for
data BinTree a = BTNode a | BTBr (BinTree a) (BinTree a)

instance Enumerated (BinTree Label) where
   enumeration = eMemoize $ eSum (eNode (BTNode A))
(eProd BTBr eBinTree eBinTree)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120623/826fa757/attachment.htm>

More information about the Haskell-Cafe mailing list