Skip to content

Instantly share code, notes, and snippets.

@tangentus
Last active August 8, 2020 00:06
Show Gist options
  • Save tangentus/a1cebbf48ccee225c701d1b0cfe7d5b0 to your computer and use it in GitHub Desktop.
Save tangentus/a1cebbf48ccee225c701d1b0cfe7d5b0 to your computer and use it in GitHub Desktop.
A methodology for currying
anchor = proc do |a|
proc {|b| "#{a} #{b}" }
end
append = proc {|p| p.call("b")}
(anchor >> append).call("a")
anchor.call("a").call("b")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment