Uncategorized Category

Chapter 7: Trees

In: Uncategorized
I start off confidently, typing in the first example into my scratch file: > data Tree = Leaf a | Branch (Tree a) (Tree a) Of course, ghci complains bitterly, and strangely Prelude> :l 7.hs [1 of 1] Compiling Tree [...]

Chapter 6: Shapes III: Perimeters

In: Uncategorized
(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 [...]
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 it's no longer useful. The [...]
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 same: 100*(round 1.01) [...]

Meta: Shaving the Haskell blog yak

In: Uncategorized
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" [...]

some books

In: Uncategorized, haskell

About this blog

Osfameron's blog on Haskell, Perl programming, stuff.


Categories