I bought a Raspberry Pi 5 because I wanted to run a temperature sensor. Mostly so I can check how effective my portable air conditioning unit from DeLonghi actually is in my apartment. I naively assumed that v5 of the Pi (as opposed to my ancient v3) would support video over USB-C, or at least have a standard USB-C port. I also assumed I could just flash Home Assistant onto a USB stick and it…
Remember when it was all the rage to write articles about functional programming (FP) in Javascript by explaining how you can chain .map , .filter and .reduce on lists? I hated that. I think that it conditions people into thinking that FP is all about list comprehensions. And when lists aren’t convenient anymore (more on this later), they then resort to imperative programming, thinking that FP…
I am fully committed to using Janet this year! At least I hope so. One of my goals is to get really familiar and fluent with using parsing expression grammars (PEG). I’ve always liked parser combinators, which seem to be more or less the same thing. One of the most basic and typical ways to parse input in Advent of Code is to split a string into a lines and split each line on spaces. 1 2 3 4 5 6…
I firmly believe that you should use light mode when the ambient lighting is bright. As far as I know, science agrees with that, since dark text on a white background is easier to read than the opposite. But after the sun has set and you’ve dimmed all the lights, staring at a bright screen seems wrong and it looks out of place when the rest of your system switches to dark mode. For the longest…
Yesterday I got my feet wet by rendering a single, measly splice. And at first it didn’t look like I’d even accomplish that before the end of the day. Today I want to extend the example by adding more splices that operate on different data. In the compiled splices tutorial they have an example that shows how to render a list of persons. But in a real world application with dozens of routes you…
Summary After utilizing Nix and HM to manage both a MacOS and a NixOS machine for a solid two years, I can confidently say that the experience has been incredibly pleasant overall. Reflecting back, the major advantages that stood out, and continue to do so, include: Seamless project environment management with nix-direnv , which, in my opinion, is unmatched. Having a single package manager instead…
Introduction I built a website so trivial that you might wonder why I even bother writing about it. It consists of a static site which is, unfortunately, still built with Gatsby, a Javascript framework. The content comes from a content management system called Contentful. The most complex part is the members-only area, which is the part I rebuilt and what this post is all about. The members area…
I’m a fan of functional programming (FP), especially when it’s coupled with a powerful type system as in Haskell. But my day job revolves around Go and Javascript and involves fairly little FP. Unfortuntately the only person I can blame for that is myself! Apparently I’m not doing enough internal lobbying to convince people of the merits of FP. If I’m honest, the reason I haven’t really pushed for…
Over the last weekend I looked into the Dhall configuration language . I’m a fan of pure, functional programming in general and the works of Gabriel Gonzalez specifically and so Dhall seemed like something I would like. I’m also not super happy with the way we handle kubernetes configuration files at work through helm, so I’m always looking for alternatives to that. In this post I’ll write down my…
UPDATE 2025: Here’s an updated gist that uses a Nix shebang for a single, executable .hs file that you can run In this post I will go over the source code for unliftio-core , more specifically the MonadUnliftIO typeclass, found in Control.Monad.IO.Unlift . The typeclass is used to power the actual unliftio library, which is the one you’d use in your applications. Let’s start with an example…
When I went through Haskell From First Principle the first time, I struggled with the Compose applicative instance, which is part of an exercise in chapter 25. This post will give you a quick overview of the Compose data type and then explain how the applicative instance for that type works. The Compose data type is part of base and allows composing two functors: > :m Data.Functor.Compose > let a…