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

Ertugrul Soeylemez es at ertes.de
Mon Aug 8 16:36:18 CEST 2011


Roelof Wobben <rwobben at hotmail.com> wrote:

> I think you mean something like this :
>
> 2 ^ 3 =
> = 2 * 2 ^ 2
> = 2 * 2 * 2 ^1
> = 2 * 2 * 2 * 2 ^ 0
> = 2 * 2 * 2 * 1
> = 2 * 2 * 2
> = 4 * 2
> = 8

Yes, but that's not a rule system.  Try to come up with a rule system to
express exponentiation.  You need two rules for the algorithm you want
to implement.


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/





More information about the Beginners mailing list