Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-28 Thread Rob Ennals
On 11/28/05, Wolfgang Jeltsch <[EMAIL PROTECTED]> wrote: > > As I already said, this approach may lead to mixing different concepts. > Example: > > data Person = Person { name :: String } > data File = File { name :: String } > > A field identifier has to be seen in context of the d

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-28 Thread Wolfgang Jeltsch
Am Sonntag, 27. November 2005 22:34 schrieb John Lask: > correct me if I am wrong but ... > > 1. Field namespaces: solved by using type classes > > This would imply that the type of the field is the same between all > instances of this common field. > > Under this proposal two fields with s

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-28 Thread Johannes Waldmann
> It actually sounds a lot like pattern guards, since you're suggesting this > sugar could be applied to any sort of object? So your desugarer would > allow a function like > > islong :: [a] -> Bool > islong {length = l} = l > 10 this looks like a hack that only works for one-argument functions

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-28 Thread David Roundy
On Sun, Nov 27, 2005 at 08:47:54PM +, Rob Ennals wrote: > On 11/23/05, David Roundy <[EMAIL PROTECTED]> wrote: > > > 3. "Safe" getters for multi-constructor data types: ditto > > > > I think either you misunderstood my meaning by "safe", or I misunderstood > > your paper. I meant that if I wri

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-27 Thread John Lask
:: String }, { name :: Int } John - Original Message - From: "Rob Ennals" <[EMAIL PROTECTED]> To: "Johannes Waldmann" <[EMAIL PROTECTED]> Cc: Sent: Wednesday, November 23, 2005 1:32 AM Subject: Re: Records (was Re: [Haskell] Improvements to GHC)

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-27 Thread Rob Ennals
On 11/23/05, David Roundy <[EMAIL PROTECTED]> wrote: > On Tue, Nov 22, 2005 at 02:32:47PM +, Rob Ennals wrote: [snip] > > 1. Field namespaces: solved by using type classes > > But these classes are required to be manually specified, right? This avoids > the problem of proliferation of typeclas

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-24 Thread Keean Schupke
you can always do: case (field1 record,field2 record, field3 record ...) of (pat1,pat2,pat3) -> _ -> Which lets you pattern match on fields independantly of their position in the record. Keean. David Roundy wrote: On Wed, Nov 23, 2005 at 02:58:43PM +0100, Wolfgang Jeltsch

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-24 Thread David Roundy
On Wed, Nov 23, 2005 at 02:58:43PM +0100, Wolfgang Jeltsch wrote: > Am Mittwoch, 23. November 2005 14:22 schrieb David Roundy: > > On Tue, Nov 22, 2005 at 02:32:47PM +, Rob Ennals wrote: > > [...] > > > > 7. Unordered records: yep (if I understand the problem correctly) ... > You can just omit

Re[2]: Records (was Re: [Haskell] Improvements to GHC)

2005-11-23 Thread Bulat Ziganshin
Hello David, Wednesday, November 23, 2005, 4:22:47 PM, you wrote: >> 7. Unordered records: yep (if I understand the problem correctly) DR> I don't think you understood correctly. What I'd like (and this is another DR> one of those David-specific issues--I've never heard anyone else complain DR>

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-23 Thread Wolfgang Jeltsch
Am Mittwoch, 23. November 2005 14:22 schrieb David Roundy: > On Tue, Nov 22, 2005 at 02:32:47PM +, Rob Ennals wrote: > [...] > > 7. Unordered records: yep (if I understand the problem correctly) > > I don't think you understood correctly. What I'd like (and this is another > one of those Davi

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-23 Thread Malcolm Wallace
David Roundy <[EMAIL PROTECTED]> writes: > > 7. Unordered records: yep (if I understand the problem correctly) > > I don't think you understood correctly. What I'd like (and this is another > one of those David-specific issues--I've never heard anyone else complain > about this) is to be able to

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-23 Thread David Roundy
On Tue, Nov 22, 2005 at 02:32:47PM +, Rob Ennals wrote: > Since discussion has returned to records, it might be useful for me to > post a link to a proposal that I knocked up a while back when this > topic came up a few years ago: > > http://www.cambridge.intel-research.net/~rennals/records.pd

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-23 Thread Rob Ennals
Hi guys, Since discussion has returned to records, it might be useful for me to post a link to a proposal that I knocked up a while back when this topic came up a few years ago: http://www.cambridge.intel-research.net/~rennals/records.pdf The basic idea is to keep records largely as they are, bu

Re: [Haskell] Improvements to GHC

2005-11-23 Thread Stefan Karrmann
My 2 cents: John Lask (Thu, Nov 17, 2005 at 08:57:52AM +1030): > I would like to sound out the Haskell community on what the feeling are > most desirable to improve the "commerciality" (i.e. its general use) of ghc > and Haskell in general (as distinct from feature set) > > 3) Macro / condition

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-22 Thread Johannes Waldmann
On records in Haskell - can we start by formulating requirements (design goals). What do we want from a record system, and what are non-goals. Some of the proposals here sound like records should be more like objects (with some kind of inheritance). Do we really want this? We already have inherita

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-22 Thread Gracjan Polak
2005/11/20, Georg Martius <[EMAIL PROTECTED]>: > 7. Unordered records. > I don' t understand it. > Consider this example: data DataT = DataT (Int,String) (String,String) if we treat records as tuples with labels, then we could write: data DataR = DataR {tel::Int,addr::String} {zip::Stri

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-21 Thread Andrew Pimlott
On Sun, Nov 20, 2005 at 08:54:35AM -0500, David Roundy wrote: > As an aside, what's responsible for the insanity of pattern matching record > fields being backwards? I'd bar = b to bind b to bar, not the other way > around... why should record pattern matching use '=' in a manner opposite > from th

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-20 Thread Tomasz Zielonka
On Sun, Nov 20, 2005 at 02:09:04PM -0500, David Roundy wrote: > > [x,y,z] > [...] > > R { field1 = x, field2 = y, field3 = z } > > > > I think this is very consistent. > > I see, you're right that it's consistent, but I still don't like the use of > '=' in this scenario. I understand you

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-20 Thread David Roundy
On Sun, Nov 20, 2005 at 03:43:08PM +0100, Tomasz Zielonka wrote: > On Sun, Nov 20, 2005 at 08:54:35AM -0500, David Roundy wrote: > > As an aside, what's responsible for the insanity of pattern matching > > record fields being backwards? I'd bar = b to bind b to bar, not the > > other way around...

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-20 Thread Wolfgang Jeltsch
Am Sonntag, 20. November 2005 13:40 schrieb Georg Martius: > [...] > 4. Getters for multiple data types with a common field. Do we need this? Couldn't this have ugly consequences? Say, I have a datatype with a field of a certain name and another datatype with a field of the same name. Having

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-20 Thread Tomasz Zielonka
On Sun, Nov 20, 2005 at 08:54:35AM -0500, David Roundy wrote: > As an aside, what's responsible for the insanity of pattern matching record > fields being backwards? I'd bar = b to bind b to bar, not the other way > around... why should record pattern matching use '=' in a manner opposite > from th

Re: Records (was Re: [Haskell] Improvements to GHC)

2005-11-20 Thread David Roundy
On Sun, Nov 20, 2005 at 01:40:01PM +0100, Georg Martius wrote: > 7. Unordered records. > I don' t understand it. It's just that I'd like to be able to write: data FooBar = FooBar { foo, bar :: String } such that you can't write let f = FooBar "a" "b" but instead are forced to write let

Records (was Re: [Haskell] Improvements to GHC)

2005-11-20 Thread Georg Martius
Hi folks, rather than discussing about which operator symbol to use for record access, which is really a question of personal taste we should try to seriously discuss the proposals and get to a solutions! We all seem to agree that records are broken in Haskell. In order to fix that we need a

Re: [Haskell] Improvements to GHC

2005-11-17 Thread John Meacham
On Thu, Nov 17, 2005 at 08:46:50AM -0500, David Roundy wrote: > On Thu, Nov 17, 2005 at 10:03:00AM +0100, Ketil Malde wrote: > > >2) Improving Haskell support for records. > > > > Right - the problem is that nobody seems to agree exactly how to do > > this. I like the fact that record access lo

Re: [Haskell] Improvements to GHC

2005-11-17 Thread Duncan Coutts
On Thu, 2005-11-17 at 22:11 +, Claus Reinke wrote: > > > To solve this problem I just made them all instances of a class with a > > > gameId function. Still, not ideal. > > > > That gives you a getter function but you would then need an extra setter > > function. > > But there is no need to

Re: [Haskell] Improvements to GHC

2005-11-17 Thread Claus Reinke
> > To solve this problem I just made them all instances of a class with a > > gameId function. Still, not ideal. > > That gives you a getter function but you would then need an extra setter > function. But there is no need to have two names for each label when you only want to talk about two w

Re: [Haskell] Improvements to GHC

2005-11-17 Thread Fraser Wilson
On 11/17/05, Duncan Coutts <[EMAIL PROTECTED] > wrote: That gives you a getter function but you would then need an extra setterfunction. Of course, but that offended me less -- I spent much more time getting things than setting them.  YMMV. Fraser. __

Re: [Haskell] Improvements to GHC

2005-11-17 Thread Joel Reymont
Don't get me started, please :-). I tried making each field a separate class but then needed to compose records of difference field instances which led to HList which led to GHC eating up all my memory and crashing, etc. I can see where you are going but if I have 250 records with shared

Re: [Haskell] Improvements to GHC

2005-11-17 Thread Duncan Coutts
On Thu, 2005-11-17 at 15:12 +0100, Fraser Wilson wrote: > > > On 11/17/05, Joel Reymont <[EMAIL PROTECTED]> wrote: > I vote for a separate namespace for record access functions. > > I agree, but ... > > > My users now have to deal with tiGameID, blahBlahGameID, etc. > a

Re: [Haskell] Improvements to GHC

2005-11-17 Thread Fraser Wilson
On 11/17/05, Joel Reymont <[EMAIL PROTECTED]> wrote: I vote for a separate namespace for record access functions. I agree, but ... My users now have to deal with tiGameID, blahBlahGameID, etc. andthey are all the same. To solve this problem I just made them all instances of a class with a gameId f

Re: [Haskell] Improvements to GHC

2005-11-17 Thread Joel Reymont
I vote for a separate namespace for record access functions. To me a gameID in one record is always the same gameID in another record and having to add prefixes to each access field sucks when records number in the hundreds :-(. My users now have to deal with tiGameID, blahBlahGameID, etc.

Re: [Haskell] Improvements to GHC

2005-11-17 Thread David Roundy
On Thu, Nov 17, 2005 at 10:03:00AM +0100, Ketil Malde wrote: > >2) Improving Haskell support for records. > > Right - the problem is that nobody seems to agree exactly how to do > this. I like the fact that record access looks like (is?) a simple > function application, and conversely, dislike

Re: [Haskell] Improvements to GHC

2005-11-17 Thread Ketil Malde
John Lask wrote: I would like to sound out the Haskell community on what the feeling are most desirable to improve the "commerciality" (i.e. its general use) of ghc and Haskell in general (as distinct from feature set) I think more standardization on an extended feature set would be nice. I

Re: [Haskell] Improvements to GHC

2005-11-16 Thread Greg Woodhouse
(Sorry about replying at the top. This web interface doesn't seem to want to let me do otherwise.)   I was just reading Wadler's article "How enterprises use functional languages, and why they don't" when your message came through. A definite "must read" for anyone wanting to promote the use of Has

[Haskell] Improvements to GHC

2005-11-16 Thread John Lask
I would like to sound out the Haskell community on what the feeling are most desirable to improve the "commerciality" (i.e. its general use) of ghc and Haskell in general (as distinct from feature set) my pick would be to 1) GHC runtime to be dynamically loaded. Enable the ghc runtime sys