[Haskell-beginners] Simple Chess Program for Learning FP

Jordan Cooper nefigah at gmail.com
Tue Jun 1 14:01:48 EDT 2010


FP newbie here,

I'd like to start learning how to program more purely. Immutability is
something that tends to confuse me when it comes to handling state,
and I figure the only way I'll understand is if I do it myself.

In the past I coded a little chess game in C, where two computers
played each other (not well, but they made legal moves). I figured
this might be good to try and accomplish the same thing in Haskell.

Any general advice before I embark would be appreciated, though my
main question has to do with data structures. In C I used a
two-dimensional array to represent the board (I realize there are more
efficient representations, but I'm aiming for understanding over
performance). I'm not sure what the natural functional equivalent
would be, seeing as how arrays are immutable.

Tips appreciated!

Thanks,
J


More information about the Beginners mailing list