On Jan 28, 2010, at 9:31 PM, Luke Palmer wrote:

I don't remember the name, but there is a technique where you compose
the features you want and then take its fixed point to get your AST.

Did you think of "Data types à la carte" by Wouter Swierstra?

    http://www.cs.nott.ac.uk/~wss/Publications/DataTypesALaCarte.pdf

Also see the comments on Phil Wadler's blog:

    http://wadler.blogspot.com/2008/02/data-types-la-carte.html

You can make a typeclass for each feature that uses it on any data
structure in which it is present.

I don't fully understand this sentence but it reminds me of "Finally Tagless, Partially Evaluated" by Jacques Carette, Oleg Kiselyov and Chung-chieh Shan:

    http://www.cs.rutgers.edu/~ccshan/tagless/jfp.pdf

Regarding the question of representing in the type system which features are used, phantom types might also be helpful. If I remember correctly, they were introduced by Daan Leijen and Erik Meijer to restrict a data type that represents syntactically correct database queries such that only type correct queries can be made:

    http://research.microsoft.com/en-us/um/people/emeijer/Papers/HaskellDB.pdf

Sebastian


--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to