> > > Is there any Haskell implementation that supports
> > > extensible data types, in which new value constructors
> > > can be added to a previously declared data type?
> > 
> > I think this is what TREX (extensible records) in Hugs are about. Take
> > a look at
> > 
> > http://www.cse.ogi.edu/PacSoft/projects/Hugs/pages/hugsman/exts.html

> The TREX extension enable the addition of new fields to a record type.
> What I am looking for is a way of extending a data type with
> new forms of values, and not a given value form with new "fields".
> 
Yes, ok. I agree. But couldn't you say something like

        data Expr = Int Integer
                  | Cte String
                  | Var String
                  | App (Rec ())

and extend the record in the last constructor by a label sum::
(Expr,Expr), pro::(Expr,Expr) etc.?

Axel.



Reply via email to