[Haskell-cafe] Hierachical abstraction
Sebastian Fischer
sebf at informatik.uni-kiel.de
Thu Jan 28 18:22:00 EST 2010
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.)
More information about the Haskell-Cafe
mailing list