4 ms·
I don't really consider a language to be functional without a concise application and composition operator (also automatic currying and partial application). Ho
by ilovecaching 8y ago
I don't really consider a language to be functional without a concise application and composition operator (also automatic currying and partial application). How can you be functional if you don't have the basic operators for combining and applying functions?
- ilovecaching 8y agoIt looks like Swift has automatic currying though, so that's pretty close.
- dbaupp 8y agoIt doesn't have automatic currying. What code/docs are you getting that impression from?
- plorkyeran 8y agoSwift used to have a special syntax for defining automatically curried functions, but it was removed in Swift 3: https://github.com/apple/swift-evolution/blob/master/proposals/0002-remove-currying.md https://github.com/apple/swift-evolution/blob/master/proposa...
- dbaupp 8y agoIndeed, and the compiler still had the relicts of that functionality at least until Swift 4. I'm wondering how they got the impression Swift still has currying, given it sounded like a recent "discovery".
- bgorman 8y agoIf you have automatic partial application you lose the ability to have multi-arity functions. Functional programming is about functions, not operators. In Clojure you can compose and partially apply functions with the normal functions "comp" and "partial". https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/core.clj#L2549 https://github.com/clojure/clojure/blob/clojure-1.9.0/src/cl... https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/core.clj#L2606 https://github.com/clojure/clojure/blob/clojure-1.9.0/src/cl...
- lkschubert8 8y agoAutomatic currying and partial application are really just nice to haves though. You can manually do both as long as the language supports higher order functions.