Have you seen the OOHaskell paper (the follow up to the HList paper)...
It looks like
you do much the same thing - with some differences... Would be
interesting to get your
comments on the paper:
http://homepages.cwi.nl/~ralf/OOHaskell/
Keean.
Einar Karttunen wrote:
>Hello
>
>I recently
Hello
I recently ended up hacking a quite concise implementation of
mutable open (extensible) records in Haskell. Most of the ideas
came from the HList-paper, but this seems like a very simple way of
doing things.
Run with ghci -fglasgow-exts -fallow-overlapping-instances.
Import some stuff we
> Hi,
> thx for this reply.
> Is there any overhead using this mutable?
I just thought I should point out that "Mutable" is not an haskell type.
You can see in the Utils module that it is just a type synonim for IORef:
http://icfpcontest.cse.ogi.edu/simulator/pfe.cgi?Utils#Mutable
http://haskell
ember 09, 2002 10:45
PM
Subject: Re: mutable records
hi,> Is it possible to define parts of a
record with the help of the *ST s* > monad *mutable* during the
whole program? (As is possible in Ocamel)?you can find an example of
how to do that at:http://icfpcontest.cse.ogi.ed
hi,
> Is it possible to define parts of a record with the help of the *ST s*
> monad *mutable* during the whole program? (As is possible in Ocamel)?
you can find an example of how to do that at:
http://icfpcontest.cse.ogi.edu/simulator/
look inside module Robo for example. there you will fin
Scott J. writes:
:
| Sill I want to make objects packed with their objects and
| functions. Doesn't mean that I have to use existential data types?
Sometimes you can avoid using existentials by making all your
object-updating functions return the post-update object explicitly.
For example:
"Object" in common parlance is an amalgam of: data structure, methods for that
structure, state-boxes, and compositions of this amalgam. All developed over
time using the age old method of accretion.
It says something when Scott Meyer can make a living writing books about what
you shouldn't do
> Sill I want to make objects packed with their objects and
> functions. Doesn't mean that I have to use existential data types?
Only if you need to hide the type of the object.
If you don't need to hide the type then Haskell's typeclasses
give you (what I understand of) what you want.
I can w
<[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, September 03, 2002 8:44 PM
Subject: Re: mutable records
>
> > In Haskell one can use existential lists but I doubt about the
> > efficiency.
>
> Existential lists don't have any
> In Haskell one can use existential lists but I doubt about the
> efficiency.
Existential lists don't have any special time overhead. All you're
doing is making the typechecker happy about what you're doing.
Of course, there's a small overhead in that any function you invoke on
that object wi
PROTECTED]>
Sent: Tuesday, September 03, 2002 10:37 AM
Subject: Re: mutable records
> "Scott J." <[EMAIL PROTECTED]> wrote,
>
> > Is it possible to define oject types in Haskell and what does one
propose to do it?
>
> Depends on what you mean by object types. You can
hi,
Manuel M T Chakravarty wrote:
> ...
> Having said this, there are not that many situations where
> you need to do this (and in consequence ST-monadify your
> program). Purely functional updates (using the record
> syntax) where the system effectively copies the whole record
> (not all data
"Scott J." <[EMAIL PROTECTED]> wrote,
> Is it possible to define oject types in Haskell and what does one propose to do it?
Depends on what you mean by object types. You can surely
define a record with funcions dubbing as methods and
non-functional values dubbing as object data.
> Is it possi
Hi,
Is it possible to define oject
types in Haskell and what does one propose to do it?
Is it possible to define parts of a record
with the help of the ST s monad mutable during
the whole program? (As is possible in Ocamel)?
Thx
Scott
14 matches
Mail list logo