[Haskell] Hugs Nov2003 X Nov2002

Ketil Malde ketil at ii.uib.no
Wed Mar 17 08:59:07 EST 2004


"Stenio" <stenio at uesb.br> writes:

> It is strange because fromInt works in the hugs prompt But when I
> use it in my haskell script it doesn´t work.

It is tempting to say that it is because you top-post HTML, but
I'll be good and refrain.

> average :: Int -> Float
> average n = fromInt ( sum n ) :: Float / fromInt n :: Float

What is the type signature for sum?  What does it need to be if the
function above is going to work?

(You could also try to feed your program to GHCi, it often produces
more informative error messages (or it used to, I haven't used Hugs
for a while))

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants


More information about the Haskell mailing list