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

Ertugrul Soeylemez es at ertes.de
Mon Aug 8 12:51:34 CEST 2011


Roelof Wobben <rwobben at hotmail.com> wrote:

> After a short holiday I now studying chapter 6 of this book.
>
> For the first exercise I have to make the function for ^ for postitive
> numbers.

I assume you mean the exponentiation function, and the only real
indication for that is the solution you quoted later in your post.  To
help us help, you really should work on your problem descriptions.


> Step 1 : Defining the type
>
> ^ :: [Int] -> Int

First of all, you have to learn proper Haskell syntax.  Your type
signature is invalid.  But let me rewrite your type signature to correct
syntax:

    (^) :: [Int] -> Int

This is the type signature for a function (^), which expects exactly one
argument, a list.  Is this really what you want?  Before going any
further, you should come up with the right type signature for your
function.  Once you have that, we will continue.


Greets,
Ertugrul


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





More information about the Beginners mailing list