Remix.run Logo
jstrieb 7 hours ago

I like currying because it's fun and cool, but found myself nodding along throughout the whole article. I've taken for granted that declaring and using curried functions with nice associativity (i.e., avoiding lots of parentheses) is as ergonomic as partial application syntax gets, but I'm glad to have that assumption challenged.

The "hole" syntax for partial application with dollar signs is a really creative alternative that seems much nicer. Does anyone know of any languages that actually do it that way? I'd love to try it out and see if it's actually nicer in practice.

emih 6 hours ago | parent | next [-]

Glad to hear the article did what I meant for it to do :)

And yes, another comment mentioned that Scala supports this syntax!

runevault 4 hours ago | parent | prev | next [-]

Clojure CL as well have macros that let you thread results from call to call, but you could argue that's cheating because of how flexible Lisp syntax is.

hencq an hour ago | parent [-]

Clojure also has the anonymous function syntax with #(foo a b %) where you essentially get exactly this hole functionality (but with % instead of $). Additionally there’s partial that does partial application, so you could also do (partial foo a b).

rocqua 6 hours ago | parent | prev [-]

Someone else in the comments mentioned that scala does this with _ as the placeholder.