Something I'm really interested in is incorporating functional programming practices into my code. Despite not working in any purely functional languages (although I am starting to look at Haskell), most imperative and object oriented languages support certain functional operations. In my recent exploration of Groovy, I noticed that closures support the currying technique. Currying in Groovy takes an existing function and creates a new specialized variant. This post explains how to use currying to enhance Groovy closures.
My exploration of Groovy wasn't the first time I crossed paths with currying. Currying was mentioned in my readings on Java 8 along with my brief research so far of Haskell (a functional programming language). Currying is named after Haskell Curry, an American mathematician (the Haskell language is also named after Curry)1,2. The goal of currying in Groovy is to make specialized versions of a function. To accomplish this, pieces of a function are put into a fixed state prior to invocation.