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

David Beacham dbeacham at dbeacham.co.uk
Mon Aug 8 20:18:55 CEST 2011


On 08/08/11 16:17, Ertugrul Soeylemez wrote:
>> >  Maybe this :
>> >
>> >  x ^ 0 = 1
>> >  x ^ y = x * (y-1)
Hi Roelof,

I don't think you're far away - it could just be a typo/lack of care in 
writing it down. Have you tried putting some actual values into these 
rules? - that should help you understand what is wrong with what you've 
written down/get you closer to the correct solution.

For example: (x=2, y=4)  2^4 = 16 != 6 = 2 * 3

David.



More information about the Beginners mailing list