
7 Dec
2007
7 Dec
'07
3:43 p.m.
On Dec 7, 2007 8:39 PM, Dan Weston
compose f g = f . g
compose' f g x = f (g x)
Are you saying that these two exactly equivalent functions should have different arity? If not, then is the arity 2 or 3?
Prelude> :t let compose f g = f . g in compose let compose f g = f . g in compose :: (b -> c) -> (a -> b) -> a -> c Prelude> :t let compose' f g x = f (g x) in compose' let compose' f g x = f (g x) in compose' :: (t -> t1) -> (t2 -> t) -> t2 -> t1
The arity is the number of top-level ->
Both are arity 3.
Hmm, this still seems ill-defined to me. compose :: (Int -> Int -> Int) -> (Int -> Int) -> Int -> Int -> Int Is a valid expression given that definition (with a,b = Int and c = Int -> Int), but now the arity is 4. Luke