[Haskell-beginners] making function problem (chapter 6 of Programming in Haskell)

Daniel Seidel ds at iai.uni-bonn.de
Tue Aug 9 15:12:56 CEST 2011


On Tue, 2011-08-09 at 12:44 +0000, Roelof Wobben wrote:
> > > PostivePower x y = x + postivePower x y
> > >
> > Do you really want to call positivePower with the same y again, or
> more
> > concretely: Is 4 * 3 = 4 + (4 * 3)?, or should there be a "2"
> somewhere?
> >
> 
> 
>  
> 
> It should be 2 so it would then be postivepower x y = x + postivepower
> x (y-1) 

Right! That's it. Now it's hopefully not a problem to write the (^)
function with the same scheme.

Cheers, Daniel.




More information about the Beginners mailing list