• en | es

Applicative Functors and data validation, part II

In the first part of this series, we went through a basic introduction to Functor and Applicative Functor. In this second part, we will go through an exercise to show how to use them to perform input data validation. Create the types: Address Body Email...


Shrinking Haskell Docker images using multi-stage builds

I have recently discovered Docker's new multi-stage build feature. This has been a great help in answering my question of how to reduce the size of my haskell images for deploying, as the main haskell image on Docker Hub is over 1GB before you start...


Lambda Calculus in Clojure (Part 1)

Lambda Calculus is the smallest programming language. As we saw on my previous post, the only building blocks available are functions, variables and expressions. There are no built-in primitive values or operations. How can we then solve real-world problems using Lambda Calculus? In this post,...


Recursion

Recursion is a technique that allows us to break down a problem into smaller pieces. This technique allows us to remove some local side effects that we perform while writing looping structures and also makes our code more expressive and readable. In this post we...


On Tail Call Optimisation

If you are interested in functional programming as many of our craftspeople are, you will have heard talk about tail recursion. Tail recursion refers to a recursive function call that has been made from tail position. When a function call is in tail position it...


Applicative Functors and data validation

I am currently reading Haskell Programming from first principles, also known as the Haskell book, as part of my journey to learn functional programming. The book has helped me to acquire many new intuitions and I will share two of them, Functors and Applicative Functors....


Functional Programming and Reactive Architecture Part 2

Reactive systems As engineers we want to build systems that are valuable for the consumers; a reactive system strives to provide a correct answer in a timely manner to its users whether they are humans or other systems. For this reason a fundamental quality of...


Katas For Functional Calisthenics

The Setup While working on katas to test the functional calisthenics I realized that some of the rules were not going to be covered by the rules for the katas that I had choosen. Therefore, some additional rules/premises/requirements to the katas were needed. Here I...


Lambda Calculus for mortal developers

Lambda Calculus sounds like an arcane term that only functional programming wizards can understand. Nothing could be further from the truth. We use Lambda Calculus everyday when we program. It is the most reducible form of all Functional Programming languages; the primitive building block of...


Side effects

Functional programming is based on the simple premise that your functions should not have side effects, they are considered evil in this paradigm. If a function has side effects we call it a procedure, so functions do not have side effects. We consider that a...


Lambda World Conference 2017

Thanks Codurance for giving me the opportunity of attending Lambda World Conference 2017 last 26th and 27th October in Cádiz (Spain), a Functional Programming event consisting of two intense days: A half-day of open space A half-day of workshops A full day of talks Rúnar...


Conventional Interfaces in Functional Programming

Whilst reading Structure and Interpretation of Computer Programs, also known as the SICP book, I discovered the concept of Sequences as Conventional Interfaces. Even though it is an idea that I was somewhat familiar with, it was the first time I encountered a more formal...


Functional Programming and Reactive Architecture Part 1

Writing enterprise software is difficult and as engineers our job is to deliver value for the business within the boundaries of time, budget and resources. Complexity is what makes it difficult for us to deliver this value; we will always have to deal with the...


Functional Calisthenics

The Setup While working on a Clojure application that was for production, rather than being an exercise, I saw that I was using OO programming with the syntax of Clojure. I was having problems coming back to change code that I have done not long...


Akka basics

As the previous post explained our system is based on Akka. Before going into more detail about our solution, I'd like to explain what Akka is about and why it is so awesome. Akka is a toolkit and not a framework, you can simply use...