<insert original title here>

Programming, Haskell, and games

Archive for March 2010

A State Monad Tutorial

with 2 comments

Code that is intended to be typed in a ghci session or output from ghci is contained in a

green background.

Code that is intended to be loaded from a source file by ghci or other Haskell code is contained in a

blue background.

Monads tend to be a difficult concept for beginners to understand. In this guide, I try a different approach by explaining non-monadic values and building from there. If you want to understand monads, please don’t breeze through this tutorial, as you will need to think to understand them.

I will first explain the State type. Let us import it and look at its type: Read the rest of this entry »

Written by bairyn

March 6, 2010 at 17:58

Posted in Uncategorized