Erik Poll ([EMAIL PROTECTED]) did some nice theoretical work on
this a couple of years ago. I took a quick look on his web site
but couldn't see anything on it there. Maybe he can help?
Simon
Perhaps the subtyping of O'Haskell is interesting:
http://www.cs.chalmers.se/~nordland/ohaskell/
/Peter Ljunglöf
On Mon, 25 Sep 2000, Jose Romildo Malaquias wrote:
> Is there any Haskell implementation that supports
> extensible data types, in which new value constructors
> can be added t
On Mon, 25 Sep 2000, Jose Romildo Malaquias wrote:
> 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
On Mon, Sep 25, 2000 at 11:37:24AM +0100, Chris Angus wrote:
> I've not seen this before,
>
> out of interest, why would you want/need such a thing?
> >
> > Is there any Haskell implementation that supports
> > extensible data types, in which new value constructors
> > can be added to a previous
On Mon, Sep 25, 2000 at 01:01:25PM +0200, Axel Simon wrote:
> On Mon, 25 Sep 2000, Jose Romildo Malaquias wrote:
>
> > 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 thi
Hi,
Jose> I am working on an Computer Algebra system to transform
Jose> mathematic expressions, possibly simplifing them. There is a
Jose> data type to represent the expressions:
Jose> data Expr = Int Integer | Cte String | Var String | App Fn [Expr]
Jose> An expression may
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
> > > 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
Just wondering if you'd seen the dynamic
datatype which basically gives you an "Any"
in ghc/hugs
> -Original Message-
> From: Jose Romildo Malaquias [mailto:[EMAIL PROTECTED]]
> Sent: 25 September 2000 12:14
> To: Chris Angus
> Cc: [EMAIL PROTECTED]
> S
If you use Hugs -- and possibly GHC -- you might be able to use the
"Either" constructor for subtyping. I first saw this pattern in
"Modular Monadic Interpreters" (or something like that) by Jones,
Liang and Hudak. [Apologies if I didn't get the attribution right.]
data Expr a = Int Integer
At 07:46 25-9-00 -0300, Prof. José Romildo Malaquias wrote:
>Hello.
>
>Is there any Haskell implementation that supports
>extensible data types, in which new value constructors
>can be added to a previously declared data type,
>like
>
> data Fn = Sum | Pro | Pow
> ...
> ex
PROTECTED]
> Subject: Re: Extensible data types?
>
>
> At 07:46 25-9-00 -0300, Prof. José Romildo Malaquias wrote:
>
> >Hello.
> >
> >Is there any Haskell implementation that supports
> >extensible data types, in which new value constructors
On Mon, Sep 25, 2000 at 03:33:54PM -0700, Peter Achten wrote:
> At 07:46 25-9-00 -0300, Prof. José Romildo Malaquias wrote:
>
> >Hello.
> >
> >Is there any Haskell implementation that supports
> >extensible data types, in which new value constructors
> >can be added to a previously declared data
> In the Clean Object I/O library we encountered a similar challenge and
> solved it using type constructor classes. The solution can also be used in
> Haskell. The basic idea is as follows:
>
I didn't read your message in detail, but I wonder if this is related
to the trick TclHaskell / FranT
Jose Romildo Malaquias <[EMAIL PROTECTED]> writes:
> Hello.
>
> Is there any Haskell implementation that supports
> extensible data types, in which new value constructors
> can be added to a previously declared data type,
> like
>
> data Fn = Sum | Pro | Pow
> ...
> extend dat
At 11:18 25-9-00 -0300, Prof. José Romildo Malaquias wrote:
[...skip...]
>And then how would I define data types based on Fn ? The math expressions
>my system has to deal is expressed as something like
>
> data Expr = Int
> | App Fn [Expr]
>
>I cannot just define
>
>
On Mon, Sep 25, 2000 at 02:42:20PM +0200, John Hörnkvist wrote:
> If you use Hugs -- and possibly GHC -- you might be able to use the
> "Either" constructor for subtyping. I first saw this pattern in
> "Modular Monadic Interpreters" (or something like that) by Jones,
> Liang and Hudak.
> [..
On Tue, Sep 26, 2000 at 09:56:18AM -0700, Peter Achten wrote:
> At 11:18 25-9-00 -0300, Prof. José Romildo Malaquias wrote:
>
> [...skip...]
> >And then how would I define data types based on Fn ? The math expressions
> >my system has to deal is expressed as something like
> >
> > data Ex
At 12:55 26-9-00 -0300, Prof. José Romildo Malaquias wrote:
[...skip...]
This solution works great for the data type, but, at least
to me, it seems to make it too dificult to write functions
over ExprExt.
Consider for example the original version of the addition
operation (somehow simplified) on
diff fn | match fn sine = cosine
diff fn | match fn cosine = neg `compose` cosine
> -Original Message-
> From: Jose Romildo Malaquias [mailto:[EMAIL PROTECTED]]
> Sent: 25 September 2000 12:14
> To: Chris Angus
> Cc: [EMAIL PROTECTED]
> Subject: Re: Extensible data typ
On Thu, Sep 28, 2000 at 12:00:11PM +0100, Chris Angus wrote:
> How about defining a Datatype Fn which defines all functions
> and building in terms of this
>
> data Expr = Int Integer
> | Cte String
> | Var String
> | App Fn [Expr] deriving (Show)
>
> data Fn = Fn S
Hello.
I am back with the issue of extensible union types. Basically
I want to extend a data type with new value constructors.
Some members of the list pointed me to the paper
"Monad Transformers and Modular Interpreters"
Sheng Liang, Paul Hudak and Mark Jones
The authors suggest using a
>
> The above code fails to type check due to instances
> overlapping. Hugs gives the following error message:
>
In Hugs, there is a flag that you can set to allow overlapping instances
:s +o
In GHC, you can also set
-fallow-overlapping-instances
BTW, I use extensible union t
It is exactly for reasons like these that we developped our small
attribute grammar system:
http://www.cs.uu.nl/groups/ST/Software/UU_AG/index.html
Doaitse Swiesrtra
At 7:21 AM -0200 10/20/00, José Romildo Malaquias wrote:
>Hello.
>
>I am back with the issue of extensible union types. Basically
I wrote:
> You may find these handy:
> class SubType a b where
> inj :: a -> b
> prj :: b -> Maybe a
>
> instance SubType a (Either a b) where
> inj a = Left a
> prj (Left a) = a
> prj (_) = Nothing
This should be:
instance SubType a (Either a b) where
inj a
25 matches
Mail list logo