automaticly create the ana, cata, hylomorphisms
Brandon Michael Moore
brandon at its.caltech.edu
Sat Nov 8 02:07:32 EST 2003
On Fri, 7 Nov 2003, Marta Isabel Oliveira wrote:
> Ok, i read the page but i'm still stuck.
> I'm reading some papers about cata, ana and hylomorphisms but i need to know where to start putting it to code.
> 1. in order to have a pre-processor, i need to have a module with ALL data types?
> 2. from this module, how could i create the cata, ana,...
> i mean,
> a)how can i represent the result in haskell
> b) how can i create the cata(whatever) without knowing all of the possible functions that may be inserted in order to it's cata be created?
> thansk a lot,
You might want to write this as a module for DrIFT. That already has code
for parsing data types and writing generated code. Once you the parsing
and pretty printing you just need to extract the AST for the morphisms
from a nice data type representing the type declaration. That should be
a simple function to write. It's a different story if you don't know what
functions you are supposed to be generating of course. You know how to
write the morpisms by hand for a given type, right?
More information about the Haskell-Cafe