What is wrong with this simple type definition? (Expecting one more argument to...)

Posted by fluteflute on Stack Overflow See other posts from Stack Overflow or by fluteflute
Published on 2012-10-15T21:29:02Z Indexed on 2012/10/15 21:36 UTC
Read the original article Hit count: 199

Filed under:

basic.hs:

areaCircle :: Floating -> Floating
areaCircle r = pi * r * r

Command:

*Main> :l basic.hs 
[1 of 1] Compiling Main             ( Sheet1.hs, interpreted )

Sheet1.hs:2:15:
    Expecting one more argument to `Floating'
    In the type signature for `areaCircle':
      areaCircle :: Floating -> Floating
Failed, modules loaded: none.

I see that areaCircle :: Floating a => a -> a loads as expected. Why is the above version not acceptable?

© Stack Overflow or respective owner

Related posts about haskell