On 12-06-23 04:38 AM, José Pedro Magalhães wrote:
On Tue, Jun 19, 2012 at 4:04 PM, Jacques Carette <[email protected]
<mailto:[email protected]>> 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)
generate
instance Enumerated (BinTree Label) where
enumeration = eMemoize $ eSum (eNode (BTNode A))
(eProd BTBr eBinTree eBinTree)
Jacques
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe