Archive for May, 2007

Chapter 6: Shapes III: Perimeters

(Haven't really had much time for Haskell this week – I had set myself the task of comparing some versions of SOE exercises, but will get back to that as soon as I can.  In the mean time, another (shortish) post in the regular series…) The first part is straight forward enough. We create a […]

Lambdacamels, slime, and a syphilitic stoat.

1. In which a challenge is thrown, but there is a spanner in the works! Haskell suddenly became “important” in the Perl community when Audrey Tang started to blog about Pugs, the prototype version of the Perl 6 interpreter/compiler. So, when I started looking at Haskell, I did so with another Perl-monger, larsen, one of […]

Trigonometry reprise

I whined on IRC about my inability to do simple trig and dakkar kindly took me through the basics of a cosine. So I sat down later to look again at an exercise I'd skipped: 2.2 to defined the function: > regularPolygon :: Int -> Side -> Shape> But I realised that I still couldn't […]

Chapter 5: Polymorphic and Higher-Order functions

This is an interesting chapter, working on the higher order functions rather than actually drawing shapes. It covers: Polymorphic types Principal type – this is an interesting idea, the type inferencer can determine that something works on an Int, say, or “Number stuff”, or “just any stuff”, or “a list of stuff”. Too general and […]

Chapter 4: Shapes II, drawing Shapes (short)

We are presented with some coercion functions and asked Ex 4.1: Why is inchToPixel x not defined as 100 * round x ? It is instead defined as round(100 * x). This is because if rounding was done on the input parameter, then whether it was, say, 1.01 or 1.99, the answer would be the […]

SOE, Erlang, etc.

David Tran got in touch to say he's also working his way through SOE, and he's posting on http://davidtran.doublegifts.com/blog/, where he's mainly posting solutions, looks good! I discussed some answers on irc with Apocalisp, who has some very subtle versions of regularPolygon and isConvex.  I may, though I still find doing proofs painful-and-not-really-fun try to […]

Meta: Shaving the Haskell blog yak

HTML is all very well and good, but frankly, I'm too lazy to mark up my&,<,> characters all the time by hand, at least withincode.  I used the POD formatter pod2html for a couple of earlyposts.  It's OK, it basically has a concept of "This is a normal textparagraph, and this is a code paragraph" […]

Chapter 3. SOE

If I found the exercises in chapter 2 a little hard, the fact that thereare only two of them in this chapter should have been a warning… Amusingly, Hudak suggests that the module SOEGraphics will notevolve, as it is designed for the textbook, however, as it happens, ithas changed its API in a significant way […]

Notes on Chapter 2 of SOE

Hello Planet A couple of weeks back, I got an email from Antti-Juhani who'd just processedmy request to have this blog added to planet Haskell.  He pointed outthat I seemed to have gone awfully quiet…  Basically, not had a lot oftuits recently, but now I'm working through SOE a bit more seriously,here are my notes […]