RE: Array + memory usage

2003-06-19 Thread Hal Daume
Someone else already replied with much information. I figured I'd try to add a small amount. Basically, to clarify, the problem is that at every character you read, you do something like 'arr // list'. (//) is *not* an O(1) operation as you might expect. In fact, it *copies* the entire array.

Re: Array + memory usage

2003-06-19 Thread Tomasz Zielonka
On Thu, Jun 19, 2003 at 11:11:00AM +0200, mies wrote: > Hello, i'm a haskell newbie, and i'm trying to use arrays for counting > letters. But when I input a textfile of lets say 100KB the program uses > 75 M of memory, and I really don;t have a clue where the problem could > be. I have searched

Array + memory usage

2003-06-19 Thread mies
Hello, i'm a haskell newbie, and i'm trying to use arrays for counting letters. But when I input a textfile of lets say 100KB the program uses 75 M of memory, and I really don;t have a clue where the problem could be. I have searched many topics here but I didn't find a solution. I have made an

Overlapping instances in existentials

2003-06-19 Thread Simon Peyton-Jones
[I'm widening this to the Haskell list, because overlapping instances are of general interest.] | To determine (SubType y Value) which is just: | (SubType y (Either Double BaseType)) | | it seems to me that GHC should (has to?) use |instance (SubType a b) => SubType a (Either x