2007-03-04 17:01 in /photo
2007-03-04 16:10 in /tech/haskell
I’m now at about 1 month into learning Haskell. I’ve been moving a little slower than I might have, partly because I’ve been trying to make sure it doesn’t crowd out other activities and partly because in theory Chris is going to catch up with me and we’ll work on this together. It’s still the case that nothing is particularly frustrating me about the language, although I’m still a little shaky on some issues of precedence, and I’m sure my style and idiom leave something to be desired. (Okay, sometimes the compiler error messages are frustratingly hard to decipher. On the other hand, they tend to point out what would have been frustrating-to-debug errors, like those precedence mistakes I continue to make.)
I’ve been venturing into little programs involving IO, since everyone seems to think that’s the scary part of Haskell. Honestly, I didn’t find it that bad. Maybe the tutorials are just getting better. I was going to write something about how I’ve come to understand IO in Haskell, but Eric at Nub Games did such an excellent job with Haskell IO for Imperative Programmers that I find I have nothing to add.
So far, the largest program I’ve written (which is not very large) is a recursive directory lister. I figured this would be a good test that I understood how to work with IO, since it was going to involve sucking things into the IO monad recursively. As I was working on it, I saw a couple other blogs posts about writing the same sort of thing. I guess other people had the same thinking. Mine is a little different than some others, because it takes input from the command line, and can work with either an initial file or directory. This is it, if anyone cares: walker.hs. (I implemented my own, non-portable, path concatenation, since the standard libraries inexplicably don’t provide this. I got a reference to a FilePath library that handles this, but didn’t want to bother installing it for a simple toy exercise.)
I’ve been thinking about how or when I’ll declare that I’ve learned Haskell well enough to satisfy my 101 in 1001 goal. I jotted down some minimal requirements:
- Complete all the CS 11 labs. I’ve done the first 4 of the 5 posted so far. I assume there will be 9 or 10 total.
- I’ve finished reading A Gentle Introduction to Haskell, although I should re-read the Arrays chapter. My next reading goal is All About Monads. After that, probably a proper book.
- Work through all of the 99 Haskell Problems. I’ve done all but one of the first 40, and I’m trying to complete about 10 per week, although that might slow down as they get harder.
- I’m thinking I’m going to write a simple web spider to do validation and link checking on my website. I pseudocoded most of this a couple nights ago, but I need to go hunt down libraries, particularly for the HTML/XHTML parsing and validation.
Once I’ve done all that, I’ll re-assess and decide if there’s more I need to do to feel like I can say that I’ve learned the language to a reasonable degree.
Oh, and I’ve been occasionally hanging out on #haskell. I’m really impressed with how friendly and helpful the people there are. IRC that’s actually useful. Who knew it existed?