sizeFM type

S. Alexander Jacobson haskell at alexjacobson.com
Sun Apr 25 16:20:42 EDT 2004


  QUESTION: "I read in a newspaper that in l981 you
  said '640K of memory should be enough for
  anybody.' What did you mean when you said this?"

  ANSWER: "I've said some stupid things and some
  wrong things, but not that. No one involved in
  computers would ever say that a certain amount of
  memory is enough for all time."

  http://www.wired.com/news/print/0,1294,1484,00.html

Dell's Poweredge servers address up to 32GB of
memory today!  There are already 5.7 billion
people on the planet (>2^31) and 741 million phone
lines.  In my mind, there is NO QUESTION that 2^31
keys is a reasonable size for a FiniteMap or will
be in the very very near future.

Moreover, it is not clear that the CPU/memory
overhead of returning Integer rather than Int for
sizeFM is sufficiently high to be worth bothering
the programmer about.

-Alex-

_________________________________________________________________
S. Alexander Jacobson                  mailto:me at alexjacobson.com
tel:917-770-6565                       http://alexjacobson.com


On Sun, 25 Apr 2004, Duncan Coutts wrote:

> On Sun, 2004-04-25 at 14:32, Serge D. Mechveliani wrote:
> > Dear GHC developers,
> >
> > Probably, it is better to provide   Integer
> > or                                  Integral a => a
> > instead of                          Int
> > in the function
> >                 sizeFM :: FiniteMap k e -> Int
> >
> > What do you think of this?
>
> Are you planning to put more than 2^31 entries into your FiniteMap?
> I don't think I could afford a machine with the >16GB of ram necessary
> to do that.
>
> I guess this same argument took place over the Prelude.length function.
> The conclusion was to add List.genericLength :: Num a => [b] -> a
>
> Duncan
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>



More information about the Glasgow-haskell-users mailing list