I write code, primarily in backend and infrastructure as a software engineer.

livecode curry

Tonight, I watched Cassandra’s talk on functional programming, and I got pretty excited about currying, composing, and piping functions. I wanted to live code some practical examples, as I must admit it took seeing this several times for me to really wrap my head around this topic and I hope this helps!

I would recommend going to Ramda.js’s website and pulling up a console there. Another option would be to npm install ramda and try these functions there. If you use sublime and do not have a JS build system, try this link from my classmate Jamil. You can also grab it from CDN via

<script src="//cdnjs.cloudflare.com/ajax/libs/ramda/0.17.1/ramda.min.js"></script>

“Pointfree Code is code that never refers to the code it handles: it focuses on the logic, easier to reason about, and never have to wonder about the state.”

This isn’t exactly related but another helpful trick I’ve learned after doing alot of data transforms in the console is to save the data object or array as a global variable and then to copy the temporary variable.

/*in console*/
Data Object = {...}; 
            // right click on the edge of the Object
            // store as a temporary variable
            // creates 'temp1'
copy(temp1) // and this is available for 
            // pasting in text editor.

This is a stub… there’s more to come

Written on August 15, 2015