On the “haskellquestions” subreddit, a user recently asked for some help with monads in Haskell. In their post, they wrote (slightly paraphrased): I feel stuck. I understand the basic concept of monads, but when it comes to the practical use of different types of monads, I am lost. My answer to them was one long comment . But, in hindsight, I think that I could have structured my answer a bit…
I have recently released my first video essay ! Unsurprisingly, it’s about monads. :) Making a video about it rather than a blog post was a choice i made almost a year ago: i wanted to learn something new, i wanted to try something different. I started this journey basically from scratch: no knowledge of video editing, no microphone, no nothing. Looking at the result now, i am conflicted: on one…
Last Wednesday, on Twitter, @TechnoEmpress posted a purposefully horrible solution to the following problem: given two types a and b , how does one test that type a is contained in type b ? Can we write a function contains such that: contains @ Int @ ( Either ( Maybe [ IO Int ]) String ) => True contains @ [ IO Int ] @ ( Either ( Maybe [ IO Int ]) String ) => True contains @ ( Maybe Int ) @ (…
I’m currently trying to validate a method I’ve found that allows a C++ library writer to do double dispatch via a visitor that also supports user-defined types (hence the “open”). I have yet to make sure that it is correct with respect to the standard and to compiler implementations… The goal of the post is to explain why I’m doing that, to present my proposal, and to plead for help from people…
Haskell’s typeclasses are somewhat akin to what object oriented languages call interfaces or abstract classes : they define a “contract”, sometimes offer a default implementation, and even share some common vocabulary: a type that is an instance of a typeclass is said to be “deriving” it. However, amongst the many differences, one stands out: while one can implement a typeclass for an existing…
A few weeks ago, I proudly released the 1.0.0-alpha version of MCL and updated the Projects page of this site accordingly , disregarding my resolution to release existing projects rather than work on new ones. In all fairness, this project isn’t of utmost importance and I’ll probably remain its only user, but to quote what I said back when I released SAW : It’s not much, mainly because no one is…
There are many topics I’d like to broach here… In order to start the writing process anew, a first, small, easy post. Context You might have noticed: I really enjoy messing with the infamous C preprocessor . Besides, I also took the habit of using Doxygen to automatically generate some documentation for my C++ project, as it offers a few interesting features in my opinion. Unlike a separate…