Haskell:
Since I mentioned the idea of monoids as a formal models of computations, John Armstrong made the natural leap ahead, to the connection between monoids and monads - which are a common feature in programming language semantics, and a...
Read on »
Posted on March 11, 2008 10:57 AM • 5 Comments •
So, after our last installment, describing the theory of monads, and the previous posts, which focused on representing things like state and I/O, I thought it was worth taking a moment to look at a different kind of thing...
Read on »
Posted on February 20, 2007 8:52 PM • 4 Comments •
As long as I'm doing all of these basics posts, I thought it would be worth explaining just what a Turing machine is. I frequently talk about things being Turing equivalent, and about effective computing systems, and similar things,...
Read on »
Posted on February 3, 2007 6:38 PM • 18 Comments •
As promised, I'm finally going to get to the theory behind monads. As a quick review, the basic idea of the monad in Haskell is a hidden transition function - a monad is, basically, a state transition function. The...
Read on »
Posted on January 31, 2007 2:02 PM • 8 Comments •
Time for more monads. In this article, I'm going to show you how to implement a very simple state monad - it's a trivial monad which allows you to use a mutable state consisting of a single integer. Then...
Read on »
Posted on January 29, 2007 8:00 AM • 9 Comments •
The biggest nightmare for most people learning Haskell is monads. Monads are the key to how you can implement IO, state, parallelism, and sequencing (among numerous other things) in Haskell. The trick is wrapping your head around them....
Read on »
Posted on January 23, 2007 3:03 PM • 11 Comments •
One thing that we've seen already in Haskell programs is type classes. Today, we're going to try to take our first look real look at them in detail - both how to use them, and how to define them....
Read on »
Posted on January 16, 2007 8:36 PM • 13 Comments •
So, we've built up some pretty nifty binary trees - we can use the binary tree both as the basis of an implementation of a set, or as an implementation of a dictionary. But our implementation has had one...
Read on »
Posted on January 1, 2007 1:36 PM • 12 Comments •
In Haskell, there are no looping constructs. Instead, there are two alternatives: there are list iteration constructs (like foldl which we've seen before), and tail recursion. Let me say, up front, that in Haskell if you find yourself writing...
Read on »
Posted on December 20, 2006 2:02 PM • 21 Comments •
Last time around, I walked through the implementation of a very simple binary search tree. The implementation that I showed was reasonable, if not great, but it had two major limitations. First, it uses equality testing for the search,...
Read on »
Posted on December 6, 2006 5:20 PM • 6 Comments •
For this post, I'm doing a bit of an experiment. Haskell includes a "literate" syntax mode. In literate mode, and text that doesn't start with a ">" sign is considered a comment. So this entire post can be copied...
Read on »
Posted on December 3, 2006 8:11 PM • 11 Comments •
Haskell is a strongly typed language. In fact, the type system in Haskell is both stricter and more expressive than any type system I've seen for any non-functional language. The moment we get beyond writing trivial integer-based functions, the type...
Read on »
Posted on December 1, 2006 1:31 PM • 26 Comments •
I wasn't really sure of quite how to start this off. I finally decided to just dive right in with a simple function definition, and then give you a bit of a tour of how Haskell works by showing the...
Read on »
Posted on November 28, 2006 12:40 PM • 27 Comments •
Before getting to the meat of the tutorial, I thought it would be good to provide some setup information in a distinct, easy to find place. This short post will tell you where to find a Haskell implementation and related...
Posted on November 28, 2006 9:32 AM • 6 Comments •
Before diving in and starting to explain Haskell, I thought it would be good to take a moment and answer the most important question before we start: Why should you want to learn Haskell? It's always surprised me how many...
Read on »
Posted on November 26, 2006 3:16 PM • 68 Comments •