[Haskell-cafe] Idiomatic usage of the fixpoint library

Sean Leather leather at cs.uu.nl
Mon Sep 5 14:25:47 CEST 2011


On Sun, Sep 4, 2011 at 13:03, Roman Cheplyaka wrote:

> * Sean Leather [2011-09-04 12:48:38+0200]
> > On Sun, Sep 4, 2011 at 12:31, Roman Cheplyaka wrote:
> >
> > > I'm looking for an example of idiomatic usage of the fixpoint
> library[1].
> > >
> > > [1]: http://hackage.haskell.org/package/fixpoint-0.1.1
> >
> >
> > I'm not sure if this counts for idiomatic usage, but you can check out
> > our approach to incrementalization.
> >
> > http://people.cs.uu.nl/andres/Incrementalization/
>
> Yeah, it has more or less the same problems as my code above.
>
> You essentially defined your tree twice (Tree and F (Tree)).
> For such a simple type it's fine, but if it was an AST with a few
> dozens of constructors, such approach would be unacceptable.
>

True. Technically, one doesn't need Expr or Tree, right? But if you prefer
to define your datatype that way, that's usually where I turn to code
generation, possibly using Template Haskell, Data.Derive, or something else.

Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110905/86c31d03/attachment.htm>


More information about the Haskell-Cafe mailing list