Haskell Hacking: a journal of Haskell programming

Haskell Hacking has moved => Go here.
2009-01-21

Moving the blog

After 3.5 years, I've finally given up on my custom blosxom and darcs blog setup, and moved the entire blog to wordpress. Now we get much more automation, and ease of use for me. Go here.

/home :: /haskell :: permalink :: rss

2008-09-30

Newest Mersenne Prime

Thanks to Ward Harold for the heads up about UCLA's new mersenne prime discovery.

With Haskell's default unbounded Integer type, you can have a look at this beast with little effort. Here's the Haskell program to print the prime to stdout:

    main = print (2^43112609-1)

Compile and run this program:

    $ ghc -O2 --make A.hs
    $ time ./A > /tmp/prime.txt
    ./A > /tmp/prime.txt  34.14s user 0.23s system 99% cpu 34.462 total

And we get a 13M file containing 31647026933025592314 ... 78265780022181166697152511. Enjoy!

/home :: /haskell :: permalink :: rss

About

Real World Haskell

RWH Book Cover

Archives

Recommended

Blog Roll

Syndicate