On 22/08/2012 16:42, Philippe Sigaud wrote:
Then, both Simen and you could code a generic algebraic datatype
generator, with the associated matching functions (and probably
mapping / reducing) Here come the whole Haskell / ML menagerie of
types:)

mixin(ADT("
Tree(T):
     Leaf(T)
   | Branch(Tree, Tree)
"));

or something like that... And then encode JSON like this.

Or update std.typecons.Algebraic to make it deal with recursive definitions...

Sounds interesting. I haven't really thought about modelling sum types yet - but I'm probably not the best person as I haven't actually used them in a functional language. I expect that D's meta-programming abilities will allow for some interesting things.

BTW thanks for your template tutorial, it's been very helpful.

Reply via email to