[Haskell-beginners] Re: Simple Chess Program for Learning FP

Yitzchak Gale gale at sefer.org
Wed Jun 2 07:21:34 EDT 2010


> if you associate positions to pieces, you can omit "Maybe" and simple
> delete positions without pieces from the Map. So your Map will only have
> 32 entries or fewer.

Yep, good point. The same is true for Data.Map, too.

> Furthermore, you could code your row and column positions (r, c) as a
> single Int p and use Data.IntMap.IntMap Piece.

Also true. I think that would really be overkill for
a chessboard, though. Unless perhaps you're trying
to build "Big Blue" in Haskell.

Regards,
Yitz


More information about the Beginners mailing list