| >> Any thumb rule for using arrays? I'm expecting access to be
| >> O(1), it is right?
|
| > In GHC, yes.
|
| (Shouldn't this really be required? I mean, the whole *point* of using
| arrays is to have O(1) random access, isn't it?)
In Hugs, no. In an ideal world, the answer would be yes, b
> "Simon Marlow" <[EMAIL PROTECTED]> writes:
>
> >> Can we also rely on destructive updates for the monadic arrays?
>
> > In GHC, yes :-)
>
> Goodie!
>
> One more question: I imagine arrays give an opportunity to optimize by
> unboxing the contained type -- any chance of that? How much space
"Simon Marlow" <[EMAIL PROTECTED]> writes:
>> Can we also rely on destructive updates for the monadic arrays?
> In GHC, yes :-)
Goodie!
One more question: I imagine arrays give an opportunity to optimize by
unboxing the contained type -- any chance of that? How much space
would an array of Ch
> "Simon Marlow" <[EMAIL PROTECTED]> writes:
>
> >> Any thumb rule for using arrays? I'm expecting access to be
> >> O(1), it is right?
>
> > In GHC, yes.
>
> (Shouldn't this really be required? I mean, the whole
> *point* of using
> arrays is to have O(1) random access, isn't it?)
>
> Can
"Simon Marlow" <[EMAIL PROTECTED]> writes:
>> Any thumb rule for using arrays? I'm expecting access to be
>> O(1), it is right?
> In GHC, yes.
(Shouldn't this really be required? I mean, the whole *point* of using
arrays is to have O(1) random access, isn't it?)
Can we also rely on destructi
> Any thumb rule for using arrays? I'm expecting access to be
> O(1), it is right?
In GHC, yes.
> Need to have a set of data, and I just want to get random
> elements from that
> Set, arrays seem like a good solution... am I right?
If you're building it once and doing lots of access, then H
On Sunday 27 January 2002 05:36, Hal Daume III wrote:
> For your last question (about reduction to hnf), use the attached
> code; search the haskell mailing list for "deepseq" for more.
Thanks... I found myself trying to define a function
> deepSeq :: [a]->[a]
to evaluate all the elements of the
For your last question (about reduction to hnf), use the attached
code; search the haskell mailing list for "deepseq" for more.
--
Hal Daume III
"Computer science is no more about computers| [EMAIL PROTECTED]
than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
On Sun, 27
Am I the only one who'd like to have some the function specified by
> scan_and_fold f e xs= (scanl f e xs, foldl f e xs)
In the Lists library. Or is it there somewhere and I missed it?
What about:
> pair (f,g) x = (f x, g x)
> cross (f, g) = pair(f.fst, g.snd)
I kind of like point free style.