Skip to content

Instantly share code, notes, and snippets.

@loloicci
Last active November 7, 2019 08:28
Show Gist options
  • Save loloicci/4fc2c8da532a177052fcd6c5e2e924ac to your computer and use it in GitHub Desktop.
Save loloicci/4fc2c8da532a177052fcd6c5e2e924ac to your computer and use it in GitHub Desktop.
Currying in nim
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