Actuarial Programming

Python Haskell R and so on

Archive for the ‘Haskell’ Category

Project Euler

leave a comment »

Stumble upon this interesting website. Interesting idea. Anyone who likes keeping some question marks in their minds must check it out!

My solution to the first question:

foldl (+) 0 [x | x<-[1..1000], x `mod` 3 == 0 || x `mod` 5 == 0]


Written by _|_

July 14, 2009 at 4:54 pm

Posted in Haskell

How do you use Haskell at work?

with 14 comments

Haskell is a beautiful language. I love Python too, but I fell in love with Haskell at first glance.

However, my problem is that I don’t know how to make use of it. Of course, I am definitely an amateur in programming, having had some programming courses in Uni, but mainly relied on internet resources. But I can figure out more ways of using Python.

So far, what I can do with haskell is to use it for office automation. Yeah, I kinda of use it the same way I used python.

I am a actuarial student, most of my stuff is in Excel; for actuarial computing, we use specialized actuairal software. How can I use Haskell in a more meaningful way?

How do you use Haskell? Especially when you are not a programmer. Thanks to whoever shares.

Written by _|_

July 13, 2009 at 3:01 pm

Posted in Haskell

Tagged with

Monty Carlo Simulation in Haskell

with 4 comments


Just created a simple simulation of the Monty Carlo game using Haskell. Apparently the code above did not fully utilize the powerful syntax of Haskell, but it is my first product. Most importantly, it gives me the right conclusion the probability of winning by staying/switching is 33.3%/66.7%. So remember, always choose to switch!

At first it was tricky to get the types correct. And it was tricky about the indentation too. After all, it was fun and I have learnt something that I already knew in a practical way. I will feed in the details tomorrow night, if I have time ^_^.

Written by _|_

January 5, 2009 at 4:03 pm

Posted in Haskell

Haskell resources

with 3 comments

As one of my new year resolution, I started to learn a new language: Haskell. Why? It is different. It is so different from most of the languages that I knew, that at first the syntax seems so unnatural. However, after a few try-out, I cannot help thinking that I may be able to do something really serious using this brilliant language.

Here are some resources, for my own convenience, and for yours in case you are also a geeky person: center of the Haskell world

GlasGow Haskell Compiler   The de facto state of art Haskell compiler 

Real World Haskell   You can read this fantastic e-book on-line for FREE! Great for an introduction with just enough details

Haskell Wiki   We just can’t get enough of wiki’s!


Haskell’    The “research branch” of haskell language. You definitely want to check it out if you are interested in the future of Haskell.

Haskell 98 Report    The definitive resource of almost everything about the language. 

Hoogle    The Haskell API search engine which searches through GHC documentation (I might be wrong on this). (Thanks to randomdeterminism for reminding me of this important one).

Hayoo    Another API search engine which searches through HackageDB (I might be wrong on this too.)

HackageDB    Haskell package database, a gold mine where you can always find treasure and pleasure

Books on Google   Books search using google.

Yale Haskell Group     These people had involved in the development and implementation of the language from the very beginning.

Written by _|_

January 4, 2009 at 10:56 am

Posted in Haskell