[Haskell-cafe] General Advice Needed ..

Ian675 adam_khan_rfc at hotmail.com
Thu Jan 14 09:38:26 EST 2010


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
rangeProduct m n
                  | m > n = 0
                  | m == n = m
                  | otherwise = m * rangeProduct (m+1) n

Totally lost! Haha..

But thanks for the book suggestion, My exam is tommorow so I'm hoping theres
an online version of this book that I can read through!

And maybe by some divine miracle I'll understand it :-)

Martin Coxall-2 wrote:
> 
>> 
>> 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 Haskell" is very good for this, because as
> the name implies, it uses Haskell to solve actual engineering problems,
> rather than approach it from the theoretical angle.
> 
> Martin
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
> 
> 

-- 
View this message in context: http://old.nabble.com/General-Advice-Needed-..-tp27161410p27162216.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list