[Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Ian675
Hi, First of all, sorry if its in the wrong section.. But I'm just having trouble getting to grips with Haskell. I have my functional programming exam tommorow and I'm struggling to understand any of this. We worked through the book The Craft Of Functional Programming and Im trying to work my

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Martin Coxall
But after that im lost :( Is there any general advice? Just keep reading the book till it drills into my big head? Is it that you're having difficulty knowing how you'd solve certain classes of problems using Haskell? You're stuck in an imperative rut? The O'Reilly book Real World

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Matthias Görgens
Hi, it may be a bit too late for you, but in general working through Smullyan's To Mock a Mockingbird (http://en.wikipedia.org/wiki/To_Mock_a_Mockingbird) may help in coming to grips with some of the theory (and intuition) behind functional programming. The Real World Haskell book is also a good

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Ian675
Pretty much yeah.. Im going through the book and things like : Define a function rangeProduct which when given natural numbers m and n, returns the product m*(m+1)**(n-1)*n I got the solution from my lecture notes but I still dont understand it.. rangeProduct :: Int - Int - Int

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Ian675
It may be a bit late but I'll try anything Thankyou, I'll have a read :-) Matthias Görgens-2 wrote: Hi, it may be a bit too late for you, but in general working through Smullyan's To Mock a Mockingbird (http://en.wikipedia.org/wiki/To_Mock_a_Mockingbird) may help in coming to grips

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Tom Tobin
On Thu, Jan 14, 2010 at 7:52 AM, Ian675 adam_khan_...@hotmail.com wrote: Is there any general advice? Just keep reading the book till it drills into my big head? Also don't be afraid to ask specific questions on the Beginners mailing list; while Cafe is a good general resource, Beginners is

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Henk-Jan van Tuyl
On Thu, 14 Jan 2010 15:38:26 +0100, Ian675 adam_khan_...@hotmail.com wrote: Pretty much yeah.. Im going through the book and things like : Define a function rangeProduct which when given natural numbers m and n, returns the product m*(m+1)**(n-1)*n I got the solution from my lecture

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Stephen Tetley
Hello Does you find this version easier to understand? rangeProduct :: Int - Int - Int rangeProduct m n = if m n then 0 else if m == n then m else m * rangeProduct (m+1) n I would suspect the main point of the example is

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Ian675
thankyou.. that made more sense to me :) What im doing now is.. Im still working through the Craft of Functional Programming book but I've found a site that has solutions to some of the excercise questions. So i'm noting them down and trying to make sense of them Is that a good approach?

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Gregory Crosswhite
Yes. An approach that I have always used that has worked well for me is to keep a list of tricks while I am studying. Whenever I get stuck on a practice problem but eventually figure it out (either by simply thinking harder, looking it up, or asking someone for help), I try to identify the

Re: [Haskell-cafe] General Advice Needed ..

2010-01-14 Thread Richard O'Keefe
On Jan 15, 2010, at 3:38 AM, Ian675 wrote: Pretty much yeah.. Im going through the book and things like : Define a function rangeProduct which when given natural numbers m and n, returns the product m*(m+1)**(n-1)*n Case analysis and recursion. If m n, the answer is 1 (the product