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.
Generalized Algebraic Data Types gives us the power to develop type-safe Free Monads, without having to rely on continuation passing style.
My answer to the question asked on r/haskell on how to test code that lives in a Monad class with polymorphic functions.
Let’s embark in a journey, from Free Monad basics to more advanced examples such as stream processing as done in IdrisPipes.
Our goal here is to provide Idris with a library for composable and effectful production, transformation and consumption of streams of data.
A showcase of how dependent typing can help both to increase type-safety and reduce to zero the cost of change when introducing type-safety in legacy code.
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 ...
Part 2 of our implementation of transducers in Idris. This time we tackle stateful transducers and transducers with completion steps.
Let’s implement a small transducer-like library in Idris, for efficient and composable algorithmic transformations.
Let’s implement an entirely type safe bowling game, where invalid games cannot even be instantiated, and see how it goes and if it is even desirable.
The 1.0.0 of Idris has been released just a few months back, just enough to start trying out the language and some of the possibilities dependent typing offers
Let’s dive in the implementation of paramorphisms in C++, a strictly more powerful recursion scheme than catamorphism, all motivated by an example.
Let us implement a board game in ClojureScript, a functional programming language transpiling to JS, from the game rules to graphics to AI (part 3).
Let us implement a board game in ClojureScript, a functional programming language transpiling to JS, from the game rules to graphics to AI (part 2).
Let us implement a board game in ClojureScript, a functional programming language transpiling to JS, from the game rules to graphics to AI (part 1).
QuickCheck’s generators can be leveraged for other purposes than just Property Based Testing. Let’s embrace the absurd world of generating random stuff!
After having spent the last three posts exploring how to implement our own QuickCheck, the goal of the next two posts will be to play with it, to test and di...
In the previous posts, we started to implement our own QuickCheck in Haskell, which we named RapidCheck, based on the original publication on QuickCheck.
In the previous post, we started to build our own QuickCheck implementation in Haskell, which we named RapidCheck. We went over the basic concepts needed to ...
In the next posts, we will go through a small implementation challenge. The goal will be to implement our own limited version of QuickCheck, the famous gener...
In the previous posts, we went over the process of building a DSL for arithmetic operations and we introduced the concept of Catamorphism as a way to decoupl...
In the previous three posts, we went over the process of building a DSL for arithmetic operations and we introduced the concept of Catamorphism as a way to d...
This post is a third of the series of post dedicated to notion of Catamorphisms and its application to build Domain Specific Languages (DSLs).
This post is a second of the series of post dedicated to notion of Catamorphisms and its application to build Domain Specific Languages (DSLs).
I recently had the pleasure to go to a Haskell workshop on Domain Specific Languages (DSL). The goal was to teach us the basics on how to build a DSL.
Implementing a merge sort in terms of a fold (left to right scan) is possible. Here is how in Haskell.
My meetup report on a talk by Arnaud Lemaire introducing the philosophy behind functional programming.
In the two previous posts, we used open recursion to provide efficient solutions to dynamic programming problems, keeping the following aspects decoupled:
In the previous post, we explored how we could leverage open recursion to solve a dynamic programming problem, while keeping the following aspect decoupled:
There is a large class of problems that we can solve by nice mathematical recurrence relations.
Last Saturday marked the first occurrence of the CPPP, the first conference dedicated to C++ on the French soil, organized by Frédéric Tingaud and Joel Falcou.
Generating Pythagorean triples using linear algrebra in modern C++ as an answer to the heated discussions around std::ranges in the C++ community.
C++ template parameters of dependent type names cannot be deduced. Let’s see why C++ cannot do much better considering its type system and some basic maths.
Answering comments on the usefulness of property based testing to ensure correctness of unstable sort.
Exploring alternatives to the hopelessly inefficient std::is_permutation.
This post is dedicated to an STL algorithm which caused me some serious performance issues at my first use of it: std::is_permutation.
Implementing a merge sort in terms of a std::accumulate (left to right scan) is possible. Here is how to merge sort using only ForwardIterators.
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...
A follow up on the study of the ideal design for the Money class, answering an interesting question on Reddit.
Let’s look at the Money class implementations found in Kent Beck, Martin Fowler and Ward Cunningham work, and propose a new one based on dependent typing.
In today’s post, we will explore the hexagonal architecture through an example, describe it, and relate it to Free Monads, a well-known and pretty popular pa...
How to design better tests? How to code using Test Driven Development? My takeways of a very instructive meetup with Romeu Moura.
I recently stumbled on a debate where J. Peterson argues that the gender pay gap is mostly not due to gender bias. Let’s see what’s wrong with his argument.
Let’s look at how the wind affect your speed on a bike, the diminishing impact of power, and why you feel the drag suddenly passed a certain speed.
Watching my GPS tracking data, I noticed my track is oscillating around my true trajectory. How much extra distance is it?
Modern conditional and unconditional language models often report their perplexity as validation metrics. Let’s see what it means.
Have you even tried to sample greedily from a language model. It’s not a good idea. Let’s discuss why.
Let’s create a simple Bayesian network to visualise how reported positive tests of COVID inform us about the real number of COVID infections.
If we succeed in this task, we will have succeeded in building what easily qualifies as one of the world most wasteful way to random shuffle. We now have a s...
A short story on the impact of ignoring errors and not knowing error modes in distributed systems, and how it lead to paralyse an entire system.