Here's a list of things I collected a conversation on partial
. Personally I think using partial
almost never has a benefit, while there are some downsides to using it. There are exceptional cases where partial
has a benefit, e.g. if you want to "wrap" a multi-arity function or a function with an unknown amount of arguments.
Some reasons not to use partial:
- Some people find it harder to find out what's happening*
- https://ask.clojure.org/index.php/8373/when-should-prefer-comp-and-partial-to-anonymous-functions?show=8374#a8374
- https://www.tiagoespinha.net/2016/12/clojure-beware-of-the-partial/
- https://twitter.com/borkdude/status/796018276044247041
- Better stack traces from SCI (if your code runs through SCI)
- Better performance in some cases (inlining / intrinsics)