Re: Desugaring instances

2009-03-05 Thread Max Bolingbroke
2009/3/5 Simon Peyton-Jones : I think that suffers from the same lack-of-memoisation as (A). > > After all, each recursive call is to (opF_aux d_a), and each such call builds > a new d_as. Thats why I mentioned CSE at the end of my email: """ To prevent reconstruction of the dictionary in gener

RE: Desugaring instances

2009-03-05 Thread Simon Peyton-Jones
| Might this be another option? Desugar the instance as: | | {{{ | Rec { | dCList :: C a -> C [a] | dCList d_a = letrec { | d_as = DC opfl opgl | opfl = opF_aux d_a | opgl = $dmopG d_as |} in d_as | | opF_aux :: C a -> a -> In

Re: Desugaring instances

2009-03-05 Thread Max Bolingbroke
2009/3/5 Simon Peyton-Jones : > Guys > > I've been struggling with how to desugar instance declarations for some time. >  It's been going round and round in my head, but without reaching a fixed > point.  Ganesh's message (below) made me realise an additional problem with > the current "solution

Desugaring instances

2009-03-05 Thread Simon Peyton-Jones
Guys I've been struggling with how to desugar instance declarations for some time. It's been going round and round in my head, but without reaching a fixed point. Ganesh's message (below) made me realise an additional problem with the current "solution". So I thought I'd take an hour to arti