Last active
November 7, 2019 08:28
-
-
Save loloicci/4fc2c8da532a177052fcd6c5e2e924ac to your computer and use it in GitHub Desktop.
Currying in nim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import currying | |
proc f(x, y: int) : int {.curried.} = | |
return x + y | |
doAssert (f(40) 2) == 42 | |
doAssert (40.f 2) == 42 | |
doAssert (40.f(2)) == 42 | |
echo "Succeed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment