Archive for the ‘category theory’ Category

Parameterised monads

Sunday, February 15th, 2009

This post assumes some knowledge of Haskell, in particular what monads and monad transformers are. It's literate Haskell, which means you can load it into ghci directly (well, you'll probably have to convert HTML entities to plain text first, particularly > and <.)

> {-# LANGUAGE NoImplicitPrelude, MultiParamTypeClasses, FunctionalDependencies #-}
> {-# LANGUAGE FlexibleInstances, FlexibleContexts, UndecidableInstances #-}
> 
> import Prelude hiding (Monad (..))
> import qualified Prelude as P
> import Control.Monad.Trans

On the Haskell blog circuit recently the notion of "parameterised monad" has been floating about, provoked by a new paper "Parameterized Notions of Computation". I'll refrain from explaining it myself, instead linking to Dan Piponi's post on the topic. If you don't already know what parameterised monads are, go and read that.

It seems that a module has already been written to encode parameterised modules and uploaded to Hackage: Control.Monad.Parameterized (package monad-param). It dates from before the current excitement (2007 and it's at version 0.0.2) so the concept is apparently not new. It does however take a somewhat different approach, one that's seemingly more general but also more cumbersome. The change in approach is explained in a blog post by its author, Edward Kmett. Here's what the "parameterized monad" class would look like if translated from the paper:

(more...)

Codata

Monday, July 16th, 2007

On Planet Haskell today, sigfpe posted a fairly readable (i.e., hopefully comprehensible to non-experts) essay about Data and Codata. I intend to do a talk on this topic someday, but in the meantime, you might find this enlightening.

Abstract category theory is like…

Sunday, June 24th, 2007

writing without nouns.

But ahhh, to write nounlessly is to live anew, not to be tied to thinking concretely, not to be anchored, not to be grounded, but rather to lift off and fly, as if previously to write was just to crawl, penned in, hemmed in, restricted.

And I might add, like an Oasis song, to say everything and yet say nothing. (The traditional way to express this is to call it “abstract nonsense“; the book Abstract and Concrete Categories: The Joy of Cats has this cute limerick which captures the feeling:

There’s a tiresome young man from Bay Shore.
When his fiancĂ©e said, “I adore
The beautiful sea,”
He said, “I agree,
It’s pretty, but what is it for?”)

Journal time: I came back from a week back home in Hampshire today, after going with my brother to the Muse concert at Wembley on Sunday. (Woo! That was brilliant!) We also went to a Spanish restaurant for Dad’s birthday, which was pretty tasty.

Our degree results came out yesterday, but I wasn’t around to get them, so I’m having to hold my breath until Monday.