sizeFM type

Tomasz Zielonka t.zielonka at students.mimuw.edu.pl
Mon Apr 26 00:38:19 EDT 2004


On Sun, Apr 25, 2004 at 04:12:25PM -0400, David Roundy wrote:
> 
> On the other hand, since they are still 32 bit computers, any given
> application can still only access 4G of memory.  This issue will only be a
> problem on 64 bit platforms which have a 32 bit Int.

Here is a funny program that gives wrong result because of length
returning Int on a 32-bit computer.

    import Data.List
    main = print (length (genericTake 5000000000 (repeat ())))

Running it shows

    $ ./A
    705032704

But this is a strange piece of code and I agree that it will hardly be a
problem on a 32 bit platform.

I believe it's impossible to write similarly behaving program for
Data.FiniteMap with current compilers and libraries.

Best regards,
Tom

-- 
.signature: Too many levels of symbolic links


More information about the Glasgow-haskell-users mailing list