Simon Thompson is an amazing teacher

Submitted by metaperl on Mon, 04/04/2005 - 9:36am.

After tripping and stumbling through "Gentle" and "YAHT", I am worlds grateful for "Craft of Functional Programming" He is not just teaching Haskell, he is teaching you how to think about problem solving.

The reason I am so excited is he gave the following exercise:

Give a function orderTriple which puts the elements of a triple of three integers into ascending order.

Ok, so far, just an ordinary question. And in most other cases that's all you would get. In YAHT, you would have copious exercises like what you just saw. In Gentle, he would show you the solution and keeping moving. It is the next sentence in this exercise that sets Thompson apart from the crowd:


You might like to use the maxThree, middle, and minThree functions defined earlier.

Kapow! After reading the first part of the exercise, my mind immediately began to scramble over how to maintain state and iterate through the elements, deleting them as I found their place.

But then Thompson *decomposed* the problem into 3 simpler problems for me!

Submitted by metaperl on Mon, 04/04/2005 - 9:39am.

I am a bit worried about iterating over the data elements 3 times as I call 3 functions for each of the positions, but it certainly is a clear solution and it doesnt hurt to have a clearly presented solution as your first cut.

As Philippa puts it: excessive worry leads to premature optimization

Submitted by jgoerzen on Mon, 04/04/2005 - 10:46am.

I completely agree. I got Craft for Christmas, and though I haven't had a lot of time to do so, I've been going through it since then. It's a great book.

Submitted by gour on Tue, 04/05/2005 - 2:10am.

I also like Craft very much and can heartily recommend it to everyone wanting to learn Haskell.

The only problem I have is not sufficient time to dedicate for learning, and when I managed to find enough time, I was (am) bitten by the poor support of Haskell tools under amd64 platform :-(

So, I just went through the whole book and now (since hugs works on amd64), I am resuming my study from the 7th chapter (I would like not to skip over too many of the exercises :-)

However, I noticed that the 2nd part of the book 'drives' in much higher gear. Watch out:-)

Sincerely,
Gour

Submitted by jgoerzen on Tue, 04/05/2005 - 7:10am.

What sort of amd64 problems are you having? I'm running Debian amd64, and both ghc and hugs are working just fine. (ghci doesn't work yet, but maybe it does in 6.4)

Submitted by gour on Tue, 04/05/2005 - 8:37am.

What sort of amd64 problems are you having? I'm running Debian amd64, and both ghc and hugs are working just fine. (ghci doesn't work yet, but maybe it does in 6.4)

Well, on x86 I started my adventure with Haskell on Helium, but move to amd64 meant: no more Helium - it cannot compile.

Then, I was also not able to compile hugs - only the newest (2005) version compiles fine and it is my last resort for contiuning my self-study of Haskell :-)

As you wrote, there is no ghci; attempt to compile gtk2hs also fails because ffi support is lacking :-(

I expected that 6.4 would resolve some issues, but c2hs does not compile with 6.4 (no cabal support and old packaging does not work.)

ffi support is not done for amd64 and pulling Adjustor.c (or how it is named) from CVS and attempt to compile gtk2hs also failed - see #1163215 on ghc bugs.

darcs is the only program which compiles fine with both 6.2.2 & 6.4 :-)

So, there are big problems in getting Haskell compiler to work with e.g. gtk2hs GUI library and that's pretty much very decent requirement, i.e. to have working compiler and bindings for some GUI toolkit.

However, I won't give up - I try to help gtk2hs project.

Haskell is a beautiful language and I (sincerely) hope it will come out of 'research & theory-only domain' and prove itself as a viable general-programming language for a wider programmer's audience.

Your site is a wonderful contribution along the line ;)

Sincerely,
Gour

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.