Re: Q: Efficiency of Array Implementation

1999-02-22 Thread Shin-Cheng Mu
On Fri, 19 Feb 1999 08:33:13 -0800 Simon Marlow <[EMAIL PROTECTED]> wrote: > There's a well-known trick the compiler can play to make (//) work in > constant time: namely instead of copying the array you perform the update > descructively, but ensure that any references to the old array are > ind

RE: Q: Efficiency of Array Implementation

1999-02-19 Thread Simon Marlow
> This reminds me of a question I could not solve on my own yet (due to > lack of an operational profiler for the most part): Is it > possible that > ghc knows how to transform Array data structures into destructive > arrays in some settings? If you mean does ghc ever implement the (//) operatio

Re: Q: Efficiency of Array Implementation

1999-02-19 Thread fis
> Date: Fri, 19 Feb 1999 09:41:58 +0100 (MET) > From: Lennart Augustsson <[EMAIL PROTECTED]> > CC: [EMAIL PROTECTED], [EMAIL PROTECTED], > [EMAIL PROTECTED] > > > > Concerning 'rapid access' you found in docs - it is hard to believe > > this access is as fast as in C array - i mean changi

Re: Q: Efficiency of Array Implementation

1999-02-19 Thread Ch. A. Herrmann
Hi, > "S" == S D Mechveliani <[EMAIL PROTECTED]> writes: S> Concerning 'rapid access' you found in docs - it is hard to S> believe this access is as fast as in C array - i mean changing S> X[i] in array X. Because when this change is done fast, it is a S> side effect, breaks

Re: Q: Efficiency of Array Implementation

1999-02-19 Thread Lennart Augustsson
> Concerning 'rapid access' you found in docs - it is hard to believe > this access is as fast as in C array - i mean changing X[i] in array > X. Because when this change is done fast, it is a side effect, breaks > functionality. Extracting values from an array can be as fast as in C. The tricky

Re: Q: Efficiency of Array Implementation

1999-02-19 Thread S.D.Mechveliani
Concerning 'rapid access' you found in docs - it is hard to believe this access is as fast as in C array - i mean changing X[i] in array X. Because when this change is done fast, it is a side effect, breaks functionality. I always thought that this is the main cost the functional world pays for th

Re: Q: Efficiency of Array Implementation

1999-02-19 Thread Jan Laitenberger
Dear Mr. Mechveliani, > I thought efficient arrays are impossible in functional language. I'm not sharing this thought... Here is a quote from the Haskell Library Report: \begin{quote} ``Haskell provides indexable arrays, which may be thought of as functions whose domains are i

Re: Q: Efficiency of Array Implementation

1999-02-19 Thread S.D.Mechveliani
I thought efficient arrays are impossible in functional language. Binary trees to be used instead, and still they will be much slower than C array. So we have to organise the data so that to avoid the access by index - as possible. Also the C array holds the block of memory, no matter what part o