
----------------------------------------
Date: Mon, 8 Aug 2011 14:59:39 -0700 From: kc1956@gmail.com To: beginners@haskell.org Subject: Re: [Haskell-beginners] making function problem (chapter 6 of Programming in Haskell)
Hint
positivePower :: Int -> Int -> Int positivePower x 1 = x positivePower x y = dododoo positivePower yadayada
-- -- Regards, KC
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
oke. I see it I'm going for this : postivePower :: Int -> Int -> Int PostivePower x 1 = 1 because when you multiply something by one is remains the same value. PostivePower x y = x + postivePower x y for example x = 4 y = 3 4 * 3 = 4 + 4 * 2 4 + 4 + 4 * 1 4 + 4 + 4 4 + 8 12 Roelof