Re: Why are strings linked lists?

2003-11-28 Thread John Meacham
On Fri, Nov 28, 2003 at 09:21:50PM +, Glynn Clements wrote: > What Unicode support? > > Simply claiming that values of type Char are Unicode characters > doesn't make it so. > > Actually supporting Unicode would require re-implementing toUpper, > toLower and the is* functions, as well as at l

Re: Why are strings linked lists?

2003-11-28 Thread Lennart Augustsson
Glynn Clements wrote: What Unicode support? Simply claiming that values of type Char are Unicode characters doesn't make it so. Just because some implementations lack toUpper etc. doesn't mean they all do. Hbc has had those implemented for maybe 10 years. -- Lennart __

Re: Why are strings linked lists?

2003-11-28 Thread Glynn Clements
Wolfgang Jeltsch wrote: > > > As a matter of pure speculation, how big an impact would it have if, in > > > the next "version" of Haskell, Strings were represented as opaque types > > > with appropriate functions to convert to and from [Char]? Would there be > > > rioting in the streets? > > > >

Re: Why are strings linked lists?

2003-11-28 Thread Hal Daume III
> > For me, there would rather be celebration :), especially if these could be > > tuned to only use 8 bits. > > What do you mean with this? Hopefully, not dropping Unicode support because > this would be a very bad idea, IMHO. I mean to have the option of using Unicode or plain 8bit ascii as yo

Re: Why are strings linked lists?

2003-11-28 Thread Wolfgang Jeltsch
Am Freitag, 28. November 2003 19:21 schrieb Hal Daume III: > > As a matter of pure speculation, how big an impact would it have if, in > > the next "version" of Haskell, Strings were represented as opaque types > > with appropriate functions to convert to and from [Char]? Would there be > > riotin

Re: Why are strings linked lists?

2003-11-28 Thread Hal Daume III
> As a matter of pure speculation, how big an impact would it have if, in > the next "version" of Haskell, Strings were represented as opaque types > with appropriate functions to convert to and from [Char]? Would there be > rioting in the streets? For me, there would rather be celebration :), es

Re: Why are strings linked lists?

2003-11-28 Thread sebc
On Fri, Nov 28, 2003 at 12:37:30PM +0100, Wolfgang Jeltsch wrote: > > > > So, what is happening that there is 1 cell in the heap > > containing the representation of 'a', and then a linked list > > of length 500, where each element points to that cell. > > Yes, you're right. But if you choose

Re: Why are strings linked lists?

2003-11-28 Thread Matthias Kilian
On Fri, Nov 28, 2003 at 11:31:51AM +0100, Wolfgang Jeltsch wrote: > > On my machine "replicate 500 'a'" will use 90MB of space! > > You have to take into account that Chars (in GHC) take 4 bytes of memory > because they denote Unicode codepoints. 5,000,000 times 4 bytes is already 20 > M

Re: Why are strings linked lists?

2003-11-28 Thread Wolfgang Jeltsch
Am Freitag, 28. November 2003 12:10 schrieb Koen Claessen: > Wolfgang Jeltsch wrote: > | > 1. Today I spend a few hours trying to track down a memory leak. It > | > turns out I just didn't realize how much space a string takes up. > | > On my machine "replicate 500 'a'" will use 90

Re: Why are strings linked lists?

2003-11-28 Thread Koen Claessen
Wolfgang Jeltsch wrote: | > 1. Today I spend a few hours trying to track down a memory leak. It | > turns out I just didn't realize how much space a string takes up. | > On my machine "replicate 500 'a'" will use 90MB of space! | | You have to take into account that Chars (in GH

Re: Why are strings linked lists?

2003-11-28 Thread Wolfgang Jeltsch
Am Freitag, 28. November 2003 04:32 schrieb Ben Escoto: >Hi, can someone tell me why Haskell strings are linked lists? I think they are lists because there is already good support for lists in Haskell. You can just take the many list functions and apply them directly to strings. You could then

Re: Why are strings linked lists?

2003-11-28 Thread Jerzy Karczmarczuk
John Meacham wrote: [EMAIL PROTECTED] wrote: ... As a matter of pure speculation, how big an impact would it have if, in the next "version" of Haskell, Strings were represented as opaque types with appropriate functions to convert to and from [Char]? Would there be rioting in the streets? I also h

Re: Why are strings linked lists?

2003-11-28 Thread John Meacham
On Thu, Nov 27, 2003 at 10:54:11PM -0500, [EMAIL PROTECTED] wrote: > OK, to be fair, it does make string-to-string operations a bit more > convenient. Apart from undergraduate homework exercises and some > specific domains, though, this isn't exactly the "common case" of > all situations where peo