RSSAmplifier

Blog

dcastro

diogocastro.comRSS feed ↗4 posts

Latest posts

The hidden perils of MonadBaseControl

This article is also available on Serokel’s blog . MonadBaseControl is notoriously tricky to use correctly. It’s really easy to misuse and end up introducing subtle unexpected behaviour or downright bugs, even in the hands of the more experienced developers. The goal of this article is to establish a clear mental model of how to work with MonadBaseControl , recognize its dangers, and how to avoid…

Haskell's kind system - a primer

This post is available in Chinese here , thanks to JulyTreee . In this post we’ll explore Haskell’s kind system, the similarities between types and kinds, and show how these can be leveraged to write safer and more reusable code. Here’s what’s in store for today: Types and Kinds Data constructors and type constructors Type signatures and kind signatures HOFs and HKTs Other kinds Unboxed/unlifted…

Typeclasses in perspective

Typeclasses are typically taught by drawing parallels with method overloading (another form of ad hoc polymorphism), and Java-like interfaces (a form of subtyping polymorphism). Even though typeclasses are a concept in their own right, it’s only natural to want to compare them to other familiar constructs. This can lead to a lot of confusion, and the line that separates these things can be blurry.…

On emptiness, correctness and reasoning

Null . Ever since its debut in Algol W back in 1965, most programming languages have adopted this concept of nullability by default. That is, a variable of (pretty much) every type can be assigned this special null value that represents the absence of an actual value. Since then, its own maker has coined it his billion dollar mistake . Nowadays, it’s common knowledge that null is a source of…