3 ms·
I dont understand the list of supported features. In my opinion currying and variadic functions are supported in go to some degree. Variadic functions even lin
by domano 5y ago
I dont understand the list of supported features. In my opinion currying and variadic functions are supported in go to some degree.
Variadic functions even links to the go example, but classifies them as unsupported in go.
- platinumrad 5y agoVariadic functions aren't even necessary for functional programming in the first place.
- jerf 5y agoGo does have variadic functions, but what are you counting as "currying support"?
- domano 5y agoWell, since functions are first class citizens nothing stops me from turning a (a,b,c) into a (a)(b)(c)
- jerf 5y agoSure, but nothing helps it either, and you're going to take a decent performance hit if you do that because you're turning one function call, possibly inlineable, into three that aren't going to inline, even with new Go generics you will not have enough power to write a "ToCurried" function that converts to a curried version at compile time (I think you could theoretically do it with reflect at runtime, but now you're taking an even bigger performance hit...) I would not normally say any language "support currying" just by having first-class functions. Python can do several of those things I said Go can't do and I still wouldn't call that "supporting currying". It sure isn't anything like the experience of using curry & uncurry in Haskell: https://hackage.haskell.org/package/base-4.15.0.0/docs/Prelude.html#v:curry https://hackage.haskell.org/package/base-4.15.0.0/docs/Prelu...
- domano 5y agoThanks, looking at it this way makes more sense!