There is an interesting paper which includes a method of
performing this extension in Gofer:
"Monad Transformers and Monad Interpreters"
by Liang, Hudak and Jones
I think this should be available from Mark Jones' web site at OGI.
Rob MacAulay
> >
> > > 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 the TREX (extensible records) in Hugs are about. Take
> > a look at
> >
> > http://www.cse.ogi.edu/PacSoft/projects/Hugs/pages/hugsman/exts.html
> >
> > section 7.2.
>
> 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".
>
> The TREX extension would allow something like (with an inventend syntax):
>
> data T = V { field1 :: Integer
> , field2 :: Double
> }
> ...
> extend data T = V { field3 :: Char
> , field4 :: [Integer]
> , field5 :: Bool
> }
>
> which would extend the value constructor V for the data type T
> introducing new fields.
>
> This does not help me in my project.
>
> Romildo
> --
> Prof. Jos Romildo Malaquias <[EMAIL PROTECTED]>
> Departamento de Computao
> Universidade Federal de Ouro Preto
> Brasil
>
Rob MacAulay
Techinical Director Vulcan Machines
email : [EMAIL PROTECTED]
http : www.vulcanmachines.com
Tel +[44] 1763 247624 (direct)
Tel +[44] 1763 248163 (office)
Fax +[44] 1763 241291