MonoidMusicianʼs Blog

By @MonoidMusician

I believe knowledge should be free & accessible. When I have the energy and time, I will contribute to putting more knowledge out there and sharing topics I am passionate about.

This blog will be more focused on programming and mathematics, while my more personal stuff will probably continue to live on my personal website: https://monoidmusician.github.io/.

I strive to be an open book, with minimal ego involved, just insight and connection. However, I am losing patience for putting energy into ephemeral instruction, so if you want to learn something serious from me directly, maybe we can collaborate on a short blog post instead of exchanging messages on social media where it will get lost quickly.

I would also like to share bits of how I customize my software experiences and navigate the tech world. If technology isnʼt working for the people, what is it doing? (Lining the pockets of capitalists and actively oppressing the working class, apparently. Sigh…)

Get the behind-the-scenes peek at the code and my account of the technologies that go into this blog.

Posts

Series

Miniseries

  • Monoids in Public – cool little monoids and uses for monoids 2023/01/02 – 2024/09/18
  • Knowlish – A list of little things I have learned and need reminders about.
  • For the Users – My user scripts and user styles (& othersʼ!)

Ideas/WIP

I post these for a few reasons. I donʼt really have the energy to write these things properly (and I am ever so ambitious in my goals). But if you want to nudge me to write on them – or even better, if you want to contribute in some way, even just chatting or pairing on it – Iʼd be willing to prioritize them.

Admittedly the “finished” posts are only 80–90% complete themselves, shhh…

Type Theory

Linguistics of Programming

  • Iʼve been thinking a lot about selective applicative functors lately. Mostly through the perspective of two contrasting applications: selective applicative parsers, and functors for typechecking with better errors.

  • Algebra of CSS Selectors

    The fun part of this work was how to interleave nested selectors.

    My conclusion back then (2018) was that fully implementing :not() had edge cases that were not possible. But it was written before the more advanced selectors like :has() became standard.

  • Relational operators versus algebraic operators

    Infix, mixfix, distfix … but what about relfix?

    I want a < b < c to stand for a < b && b < c!! (And this to be an extensible system that users can add their own operators and precedences to.)

    This is the main difference between how mathematicians (especially category theorists) treat XYZX \to Y \to Z and how programmers treat X -> Y -> Z, by the way. The former means “two functions, which can be composed” and the latter means “a curried function of two arguments”.

Paradigms

  • I should do a blog post on what “effects” mean in FP culture

    tl;dr is “effects are as effects do”

    likeeee the real important point is itʼs all about what you leave implicit in your notation

    itʼs about notation not semantics

    in particular, this point about notation is necessary to explain why effects encompasses “pure effects” (like List, Either, Maybe, which are just data structures) and “real side effects” (like IO/Aff/Effect, of the “launch missiles” variety)

    I suppose I need to pretend to recite the history of monads and do notation in Haskell (“programmable semicolon”)

    and explaining why lists model “nondeterminism” could be a whole post of its own …

    side-{effect, condition} really just mean “not explicitly tracked in the surface syntax”

  • I should also do a blog post on “what people get wrong about the lens/prism/optics laws”, thatʼll be simpler (if more tricky)

    the main problem is that we donʼt have a good way to talk about them without invoking a metatheory of Haskell, with unification and possibly parametricity (Iʼll need to see if that comes up)

    actually, maybe parametricity is “just” the answer, and we can extract a free law from the stated laws!

  • WIP: Why you should believe in HoTT Path Induction as a (Haskell) Programmer

  • Passive stability:

    Imperative code has no passive stability: all global state is mutable, and small perturbations (say, modifying a prototype) can cause unpredictably large effects down the line, if not carefully managed. Untyped code is especially bad. Carefully managed imperative code may be stable, but this is active stability: it is not inherent to the framework but imposed on top.

    Functional code on the other hand is not only passively stable, it is anchored down solid. Each building block is given a static, local denotation, and they compose together. You may still need nonlocal knowledge of the code to understand the intent of what everything represents (ahem, boolean blindness), but the local meaning is denotationally clear.

    • I wonder: can you define a safe subset of Python/JavaScript that cannot be hijacked by mutating globals? Surely it is possible at the bytecode level, but I mean in source syntax. I guess if statements would be a start. Are numeric operations safe in Python?
  • log levels considered harmful

Data

data = informationbits & bytes + structureexpectations of what the bits & bytes can be and what they mean

Mathematics

  • Lebesgue measure and Lebesgue integration

    My two observations:

    1. I love how in order to prove how the old-fashioned Riemann integral works (characterizing what functions are Riemann integrable), you essentially have to come up with the Lebesgue measure, which paves the way for the Lebesgue integral.
    2. It is incredibly cool and incredibly counterintuitive how turning integration on its side produces better results.

Typeclasses

  • Fundeps: how they affect defining instances and instance resolution
  • Instances as biïmplications, and the unfortunate consequences (It is really hard to actually come up for a use for this, outside of specific reflection/reification contexts … harrumph maybe it actually breaks that too.) (Actually I think it is fine, but it needs to be opt-in for the sake of APIs/incremental builds.)
  • Redesigning Coercible