module curry
----
Function to curryfy a diadic function
----
function curry = |f| -> |a| -> |b| -> f(a, b)
@curry
function foo = |a, b| -> a + b
function bar = |a, b| -> a + b
function main = |args| {
# let's curryfy bar
let f = curry(^bar)
# and call it
println(f(1)(4)) # all is well
# trying with the decorated one
println(foo(1)(4))
# Blam... java.lang.NoSuchMethodError: foo
# WTF ?
}
Created
October 9, 2014 12:55
-
-
Save yloiseau/d669c0e30023bf5b5bbc to your computer and use it in GitHub Desktop.
curryfy fails in decorator
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pej is right wrt the implementation :-)