Henning Sato Rosen
2004-11-02 20:09:46 UTC
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
HUGS:
ERROR "arity.hs":17 - Equations give different arities for "fun
GHC:
arity.hs:3: Varying number of arguments for function `fun'
/Regards Henning
(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
HUGS:
ERROR "arity.hs":17 - Equations give different arities for "fun
GHC:
arity.hs:3: Varying number of arguments for function `fun'
/Regards Henning