[Haskell-cafe] different arities

Henning Sato Rosen henning.von.rosen at gmail.com
Tue Nov 2 15:09:46 EST 2004

These two functions have the same type. Is this behaviour intended?
(Can functions of the same type have different arities?)

data Fun = Increment | Square
fun:: Fun -> Int -> Int
fun  Increment n = n+1
fun  Square      = (\n -> n*n)

Error message in 
     ERROR "arity.hs":17 - Equations give different arities for "fun
     arity.hs:3: Varying number of arguments for function `fun'

/Regards Henning

More information about the Haskell-Cafe mailing list