Data representation, maybe reflection, laziness

Frank Atanassow franka at cs.uu.nl
Tue Nov 4 13:45:18 EST 2003


On dinsdag, nov 4, 2003, at 00:39 Europe/Amsterdam, Frank Atanassow 
wrote:

> For example,  our translator takes the Schema type doc (representing a 
> bibliographic entry) ... to a certain ugly datatype X.

Oops. For "X" I should have written E_doc, that is, the translation of 
Schema type "doc" is named "E_doc" ("E" is for Element); it's used in 
the example at the end.

< main    = interact work
< toE_doc = unparse{|E_doc|} . expand{|E_doc|} . reduce{|Doc|}
< toDoc   = expand{|Doc|} . reduce{|E_doc|} . parse{|E_doc|}
< work    = toE_doc . (\d -> d { authors = filter (/= "Dubya") (authors 
d) }) . toDoc

Regards,
Frank



More information about the Haskell-Cafe mailing list