Add currying examples
This commit is contained in:
parent
5b514a82bb
commit
a7edad1e66
@ -12,4 +12,7 @@ foo <- ->
|
|||||||
foo() ## Inside foo but not in baz or bar
|
foo() ## Inside foo but not in baz or bar
|
||||||
|
|
||||||
add <- x -> y ->
|
add <- x -> y ->
|
||||||
return x + y
|
return x + y ## Multivariable functions by currying
|
||||||
|
|
||||||
|
add(x) ## Returns a _function_
|
||||||
|
add(x, y) ## This is equivalent to add(x)(y)
|
Loading…
Reference in New Issue
Block a user