Continuation passing style Free Monads and direct style Free Monads

Generalized Algebraic Data Types gives us the power to develop type-safe Free Monads, without having to rely on continuation passing style when using simple Algebraic Data Types. The resulting Abstract Syntax Tree acts as easy to understand specifications for the interpreters of the language it defines.   In today's post, we will revisit the first... Continue Reading →

Answering r/haskell: How to unit test code that uses polymorphic interfaces?

This short post is an answer to the following question asked on r/haskell. The original question is about how to test code that lives in a Monad class with polymorphic functions. I highly encourage you to read the post. Its different answers are full of technical gems which we are not going to explore here... Continue Reading →

Free Monads: from the basics to the implementation of composable and effectful stream processing

In the previous post, we introduced IdrisPipes, a library for composable and effectful production, transformation and consumption of streams of data in Idris. We talked about the motivations behind this library, its API and its model, and some of the features it offers. In this post, we will embark in a journey from the basics... Continue Reading →

Monoids: what they are, why they are useful, and what they teach us about software

Monoids are a pretty interesting concept in software development. Monoids are everywhere. Monoids are simple yet powerful. And Monoids have a lot to teach us about software, in particular about composition and building powerful abstraction. This post will take you through a small tour of what Monoids are and are for. We will first define... Continue Reading →

How the List Monad helped me better understand Non-deterministic Polynomial time complexity

I have always been puzzled with the definition of NP: Non-deterministic Polynomial time complexity. A problem is in NP if it can be solved by an algorithm that runs in polynomial time on a non-deterministic Turing Machine, a computer that can "guess" which path to take toward the right answer when given a choice. I... Continue Reading →

A study of 4 Money class designs, featuring Martin Fowler, Kent Beck and Ward Cunningham implementations.

Following a TDD training that could have gone better, I started to read the Test Driven Development: by example book (by Kent Beck). It offers a perspective on TDD that is far from being dogmatic. It is a really good back and I highly encourage you to read it. But this post is not about... Continue Reading →

Create a website or blog at WordPress.com

Up ↑