Last night i have read about the curry() method in Groovy and i felt the feeling of functional programming, with the use of this curry() method.
As a novice in Groovy language, are there any methods in Groovy which provides functional programming capabilities as curry() method does?
It will be good, if those methods are been explained with an simple example. Thanks in advance.
There’s also Closure composition
And you can use the Method Reference operator
&to get a reference to a class method, which you can then use with currying or composition.ie:
There are 3 forms of
curryfor closures;currymethod which starts currying the parameters of a Closure from the left most parameterrcurrymethod, which starts currying the parameters from the rightncurrywhich starts at the index specified by you.All 3 of those curry methods are well described in the documentation if you follow the links 🙂