getting started with Haskell

I’ve started working through Yet Another Haskell Tutorial to teach myself some haskell. I’m not too far into it, but it’s making sense so far—none of the mind-bending strangeness that I keep hearing about. Nothing that makes me want to give up Ruby either.

Here’s my version of a recursive multiplication by addition function from one of the exercises:

mult a 1 = a
mult a n = a + mult a (n -1)


Not nearly a Ruby master, but I'm working on it.

One of the things of been doing lately is writing about Ruby. An article of mine was released on IBM’s DeveloperWorks site last week (yay!), and just got linked from OS News (http://www.osnews.com/story.php?news_id=11574) which is pretty awesome too.


more ruby

today, i needed a class for handling IP addresses for hosts and the IPAddr class from the standard library didn’t quite do everything I needed, so I ended up writing one for myself. Now, when people do data entry into my hosts database I can keep them from entering all kinds of hokey, bad data:

here’s some trimmed output from irb:

host = IP_Addr.new(‘’, ‘’)
RuntimeError: bad ip address, can’t use network address
host = IP_Addr.new(‘’, ‘’)
RuntimeError: bad ip address, can’t use broadcast address
host = IP_Addr.new(‘’, ‘’)
=> “”
=> “”

now, I can count on my db not having network or broadcast addresses (or other invalid addresses that I’m checking for), and I can build dhcp and dns config files automaticly.