LambdaDays 2017, FP concepts and their application

In my last post I tried to summarize the main concepts expressed by Prof. John Hughes and Prof. Mary Sheeran in their wonderful keynote at the LambdaDays 2017.

If you didn’t read it, well, here it is. Go on, I’ll be waiting for you here 😁

…done?

Jokes apart, at the end of my summary I left a little bit of suspense regarding the topics of my next (this) post but I also gave a few hints about them.

So, without further ado, here there are the two “mysterious concepts”:

Continue reading “LambdaDays 2017, FP concepts and their application”

Ruby, PHP and the Array Map method

Due to my work and my academia commitments I find myself very often switching from Ruby to PHP and back again. This is making me more and more accustomed to the substantial differences between these two languages.

Among these differences the handling of collections is perhaps one of the biggest I found till now.

For example in Ruby there is a module (i.e. an object) called Enumerable that exposes a lot of useful helpers and utilities to work with collections (i.e. objects).

One of these utilities is map. The concepts underlined are pretty much the same across languages and are summarized here.

While working on a collection of objects, in particular a Nokogiri::XML::NodeSet, I recently had the need to extend the map behavior to get a collection of non duplicated Nokogiri::XML::Node elements.

Continue reading “Ruby, PHP and the Array Map method”