
Which book or tutorial has the best exercises? Whenever I learn a language I like to do tons of exercises, and in fact I keep a list of books with great exercises. I currently have Real World Haskell and Programming in Haskell (Hutton), but I feel the exercises in these books are lacking. Examples of books with great exercises are ANSI Common Lisp (Graham), Developing Applications with Ocaml (O'Reilly), The Algorithm Design Manual (Skiena), and and Enumerative Combinatorics by Stanley (this book is the king of all books when it comes to exercises). They shouldn't be impossible, but at the same time exercises like "what are the types of the following expressions" are pretty silly. I think a good book should be broken into chapters where it takes at least 10 to 20 times as long to complete the exercises at the end of each chapter than it did to read the chapter and understand the material in it.

Did you checkout The Haskell School of Expression?
http://www.haskell.org/soe/
2009/3/25 Zachary Turner
Which book or tutorial has the best exercises? Whenever I learn a language I like to do tons of exercises, and in fact I keep a list of books with great exercises. I currently have Real World Haskell and Programming in Haskell (Hutton), but I feel the exercises in these books are lacking. Examples of books with great exercises are ANSI Common Lisp (Graham), Developing Applications with Ocaml (O'Reilly), The Algorithm Design Manual (Skiena), and and Enumerative Combinatorics by Stanley (this book is the king of all books when it comes to exercises). They shouldn't be impossible, but at the same time exercises like "what are the types of the following expressions" are pretty silly. I think a good book should be broken into chapters where it takes at least 10 to 20 times as long to complete the exercises at the end of each chapter than it did to read the chapter and understand the material in it.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

You could look at my "Haskell: the craft of functional programming" as well ... http://www.cs.kent.ac.uk/people/staff/sjt/craft2e/ Regards Simon On Wed, 25 Mar 2009, Peter Verswyvelen wrote:
Did you checkout The Haskell School of Expression? http://www.haskell.org/soe/
2009/3/25 Zachary Turner
Which book or tutorial has the best exercises? Whenever I learn a language I like to do tons of exercises, and in fact I keep a list of books with great exercises. I currently have Real World Haskell and Programming in Haskell (Hutton), but I feel the exercises in these books are lacking. Examples of books with great exercises are ANSI Common Lisp (Graham), Developing Applications with Ocaml (O'Reilly), The Algorithm Design Manual (Skiena), and and Enumerative Combinatorics by Stanley (this book is the king of all books when it comes to exercises). They shouldn't be impossible, but at the same time exercises like "what are the types of the following expressions" are pretty silly. I think a good book should be broken into chapters where it takes at least 10 to 20 times as long to complete the exercises at the end of each chapter than it did to read the chapter and understand the material in it.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Wed, Mar 25, 2009 at 5:10 AM, S.J.Thompson
You could look at my "Haskell: the craft of functional programming" as well ...
http://www.cs.kent.ac.uk/people/staff/sjt/craft2e/
Regards
Simon
Thanks! Both books were available to search inside on amazon, so I was able to take a look. I especially like the amount that are included in yours, and the fact that some of them are harder. I only wish more authors appreciated the value of good exercises, which IMO are at least as important as the standard content of the book.

Zachary Turner wrote:
Which book or tutorial has the best exercises? Whenever I learn a language I like to do tons of exercises, and in fact I keep a list of books with great exercises. I currently have Real World Haskell and Programming in Haskell (Hutton), but I feel the exercises in these books are lacking.
Hi Zachary, great question. I just recently purchased "Real World Haskell" and "The Haskell School of Expression" (SOE). I'm also working through Hal Daume III's "Yet Another Haskell Tutorial" (YAHT), free online. YAHT has some hard exercises, early on. He introduces continuations in chapter 4, briefly, and then casually asks you to rewrite map and filter in continuation-passing-style. I was stumped. But most of the exercises are approachable. I have looked at Simon Thompson's book (The Craft of Functional Programming) in the bookstore and it looks elegantly written. If I'm working alone, I also appreciate having the answers to the exercises available somewhere. I like to solve the problem, then go see how much more elegantly the answer key did it. There is a website with answers to SOE's exercises: http://www.elbeno.com/haskell_soe_blog/?page_id=24 YAHT includes the answers in the appendix. I don't know about Thompson's book; maybe he can tell us where to find the answers, or if they are in the appendix. Thanks, Mike

On Wed, Mar 25, 2009 at 9:40 AM, Michael Mossey
Zachary Turner wrote:
Which book or tutorial has the best exercises? Whenever I learn a language I like to do tons of exercises, and in fact I keep a list of books with great exercises. I currently have Real World Haskell and Programming in Haskell (Hutton), but I feel the exercises in these books are lacking.
Hi Zachary, great question. I just recently purchased "Real World Haskell" and "The Haskell School of Expression" (SOE). I'm also working through Hal Daume III's "Yet Another Haskell Tutorial" (YAHT), free online.
YAHT has some hard exercises, early on. He introduces continuations in chapter 4, briefly, and then casually asks you to rewrite map and filter in continuation-passing-style. I was stumped. But most of the exercises are approachable.
I have looked at Simon Thompson's book (The Craft of Functional Programming) in the bookstore and it looks elegantly written.
If I'm working alone, I also appreciate having the answers to the exercises available somewhere. I like to solve the problem, then go see how much more elegantly the answer key did it. There is a website with answers to SOE's exercises:
http://www.elbeno.com/haskell_soe_blog/?page_id=24
YAHT includes the answers in the appendix.
I don't know about Thompson's book; maybe he can tell us where to find the answers, or if they are in the appendix.
Thanks for the good suggestions! I'll definitely check out YAHT, hard exercises sound good. I also came across Richard Bird's Haskell book, which judging from what I found on Amazon's search inside, it looks like it has some pretty serious ones, so I might check that out too. If you're an exercise freak like me, you should take a look at Richard Stanley's Enumerative Combinatorics Volume 2, page 221 (problem 19), if for no other reason than to say you've seen the best exercise in the history of exercises, across all books and fields. :P ( http://www-math.mit.edu/~rstan/ec/catalan.pdf) Even if you don't understand the material, it's pretty evident after you've scrolled down a few pages why it's so amazing. Thanks again

Michael Mossey
YAHT has some hard exercises, early on. He introduces continuations in chapter 4, briefly, and then casually asks you to rewrite map and filter in continuation-passing-style. I was stumped.
So am I. Do you have any hints for these, without giving the answers away (I know the answers are in the appendix if I really need them)?

Jason White wrote:
Michael Mossey
wrote: YAHT has some hard exercises, early on. He introduces continuations in chapter 4, briefly, and then casually asks you to rewrite map and filter in continuation-passing-style. I was stumped.
So am I.
Do you have any hints for these, without giving the answers away (I know the answers are in the appendix if I really need them)?
Well, I've got some bad news for you. He doesn't include the answers to the CPS-related questions. Note: YAHT seems to be incomplete in a number of ways, because there are chapter headings that exist only as stubs. However, it's a terrific resource, and my thanks to Hal. I decided to just move on, and I'll come back to continuations when I find them in another book. Mike

I haven't actually gotten to this exercise yet, but I feel like this is
probably related: http://www.ece.uc.edu/~franco/C511/html/Scheme/ycomb.html.
I'm not sure if it will give you some pointers in the right direction. It
basically explains how to "abstract out" the recursive part of a function
into a separate function, which is basically what you need.
On Fri, Mar 27, 2009 at 7:21 AM, Michael Mossey
Jason White wrote:
Michael Mossey
wrote: YAHT has some hard exercises, early on. He introduces continuations in
chapter 4, briefly, and then casually asks you to rewrite map and filter in continuation-passing-style. I was stumped.
So am I.
Do you have any hints for these, without giving the answers away (I know the answers are in the appendix if I really need them)?
Well, I've got some bad news for you. He doesn't include the answers to the CPS-related questions. Note: YAHT seems to be incomplete in a number of ways, because there are chapter headings that exist only as stubs. However, it's a terrific resource, and my thanks to Hal.
I decided to just move on, and I'll come back to continuations when I find them in another book.
Mike
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Fri, Mar 27, 2009 at 4:00 AM, Jason White
Michael Mossey
wrote: YAHT has some hard exercises, early on. He introduces continuations in chapter 4, briefly, and then casually asks you to rewrite map and filter in continuation-passing-style. I was stumped.
So am I.
Do you have any hints for these, without giving the answers away (I know the answers are in the appendix if I really need them)?
Alright well I just solved this one after a considerable amount of effort. The best hint I can offer without giving too much away is to try to think of a way to implement map and filter in a tail recursive manner (without CPS). In other words, the return value of the call to map (or filter), should itself be the recursive call to map (or filter). Writing map and filter in this manner, the pattern may begin to be more familiar. If you want a more detailed hint feel free to email me privately, but I don't want to give anything away to those who would rather not see any more.
participants (5)
-
Jason White
-
Michael Mossey
-
Peter Verswyvelen
-
S.J.Thompson
-
Zachary Turner