<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 12-06-23 04:38 AM, José Pedro
Magalhães wrote:<br>
</div>
<blockquote
cite="mid:CA+ZFbn_y5-XFfA9v6okM_Avg2wwvub86m+-=y2dqRg15zSJndA@mail.gmail.com"
type="cite"><br>
<br>
<div class="gmail_quote">On Tue, Jun 19, 2012 at 4:04 PM, Jacques
Carette <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:carette@mcmaster.ca" target="_blank">carette@mcmaster.ca</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<p>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.<br>
</p>
</div>
</blockquote>
<div><br>
Can you provide me a quick pointer into what methods need to
be generated automatically?<br>
</div>
</div>
</blockquote>
<br>
Sure. Given a data definition such as<br>
data Zipper a = Zip ![a] ![a] deriving (Eq,Show)<br>
(where the strictness annotations are not relevant), one would want
to automatically generate<br>
<br>
instance Enumerated Zipper where<br>
enumeration = eMemoize $ eProd Zip (eList A) (eList A)<br>
<br>
and for <br>
data BinTree a = BTNode a | BTBr (BinTree a) (BinTree a)<br>
<br>
generate<br>
instance Enumerated (BinTree Label) where<br>
enumeration = eMemoize $ eSum (eNode (BTNode A)) <br>
(eProd BTBr eBinTree eBinTree)<br>
<br>
Jacques<br>
</body>
</html>