Archive for June, 2011:

Fox & Geese in Haskell: Part 2

Last time we looked at how the board is represented in the little Fox & Geese game I wrote in Haskell. This time, I’ll cover the machinery that makes the game go: moving pieces, jumping, and validating moves. The code for this part is available in my GitHub repo under tag v0.1.2.

Read the rest…

Tags: , ,

Comments (3)


Fox & Geese in Haskell: Part 1

My next project for learning Haskell is Fox & Geese. This game has simple rules and mechanics, and it doesn’t need fancy graphics. It is pretty easy to implement a simple version quickly, so I can focus more on Haskell than details of the game. I’ll go over this in a series of posts. In part 1 I’ll talk about how I represent the game board in Haskell, and in later parts I’ll discuss input handling, drawing, and game mechanics.

Read the rest…

Tags: ,

Comments (1)


Monad Transformers

Two easy introductions to monad transformers in Haskell.

The first is a PDF, Monad Transformers Step by Step, that builds up complex functionality step by step using monad transformers.  It shows in detail how to combine transformers, and why you would want to, two things which had thoroughly confused me.

The second is another brief post from A Neighborhood of Infinity, Grok Haskell Monad Transformers.  This shows how to work with a stack of monad transformers using lift.

Tags: , ,

Leave a Comment


A Bit About Monads

Here’s a great, understandable introduction to monads.  He builds up monads as solutions to common problems.  I love explanations like that!

A Neighborhood of Infinity: You Could Have Invented Monads! (And Maybe You Already Have.).

Tags: ,

Leave a Comment


Haskell Life

I’m starting to pick up Haskell again, and this time it’s finally clicking for me. Believe it or not, Learn You A Haskell explains monads in a way that actually makes sense! While I’m learning Haskell, I’m going to be making some dumb little projects. What better way to make sure I understand how they work than by explaining them on here? And who knows, maybe you’ll catch the Haskell bug, too.

The first project is a simple implementation of Conway’s game of life. The full source is at GitHub. There isn’t much to life, really. All we have to do is read or generate a starting grid, apply the rules to make grid N+1 from grid N, then draw a grid on the screen.

Read the rest…

Tags: , ,

Comments (1)