Author Archive

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: , ,

Leave a Comment


Spin: The Game

Spin is a new Flash game I’ve been noodling on for a little while. It’s a Puzzle Bobble type game, except that the balls can freely spin like a pinwheel. The rotation is physically accurate, so as balls fall off of the board it changes speed and direction. When a ball hits the board the ball’s momentum is transferred to it, so if the board is turning slowly you can speed it up or make it turn the other way by firing the balls at it.

The feature list was miles long, but I’m getting too busy to work on it. Look forward to a second version when I can get back to it.

Tags: ,

Leave a Comment


Mako Cache Permissions

Just a quick tip about a problem I ran into with Mako recently. When it creates the cache directory for compiled template files, it sets the directory’s permissions to rwx——. This will cause a problem if you use a constant cache directory like the Mako documentation, because only the first user to run the program will have access to the compiled templates.

To get around this, be sure to use a unique cache directory for each user. On Linux, you can append the effective user id to the cache directory name like this:

CACHE_DIR = '/tmp/mako'

# ...

module_directory = '%s-%s' % (CACHE_DIR, os.geteuid())

Tags: , ,

Leave a Comment


The Age of Music Piracy Is Officially Over

I totally agree with this Wired article. All of the valid arguments by music pirates have been satisfied by the music industry.  There’s no excuse anymore. If you insist on pirating music, it’s because you want to take things you didn’t pay for, commonly called stealing.

Tags: , ,

Leave a Comment


Twitter and Advertising

Two great points in Dave Winer’s post: Twitter is not a public utility, even if it’s been acting like one; and spend less money on advertising and more money on making your website easier to use.

Tags: , ,

Leave a Comment


What’s on Willie Nelson’s Mind?

Things on Willie Nelson's mind

Tags: , , , ,

Leave a Comment


Taco Bell Programming

Ted Dzuiba makes some pretty good points in this post, but once you have to scale past one server things start to break down.

Taco Bell Programming

Tags: ,

Leave a Comment