Re: [Haskell-cafe] Open mutable records

2005-05-23 Thread Keean Schupke
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

[Haskell-cafe] Open mutable records

2005-05-22 Thread Einar Karttunen
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

Re: mutable records

2002-09-10 Thread Jorge Adriano
> 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

Re: mutable records

2002-09-10 Thread Scott J,
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

Re: mutable records

2002-09-09 Thread Iavor S. Diatchki
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

Re: mutable records

2002-09-05 Thread Tom Pledger
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:

Re: mutable records

2002-09-05 Thread Shawn P. Garbett
"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

Re: mutable records

2002-09-05 Thread Alastair Reid
> 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

Re: mutable records

2002-09-05 Thread Scott J.
<[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

Re: mutable records

2002-09-03 Thread Alastair Reid
> 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

Re: mutable records

2002-09-03 Thread Scott J.
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

Re: mutable records

2002-09-03 Thread Iavor S. Diatchki
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

Re: mutable records

2002-09-03 Thread Manuel M T Chakravarty
"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

mutable records

2002-09-02 Thread Scott J.
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