• Everything Everywhere All At Once

    It was good, but I didn’t find myself as blown away as some people seem to have been. I did have some thoughts, so here they are (spoilers!).

    Read on →

  • Lenses for Tree Traversals Redux

    Previously I wrote about how you can use explicit Traversals from lens to simplify some aspects of tree manipulation. I recently had another win using this, so here’s another case study! It also provides a better example for when you want to fold over things than the previous post had.

    Read on →

  • On Commenting Code

    Programmers like to go on about how you should or should not comment your code. This is my contribution. But first, go read Antirez’s take on this which is fantastic and says almost everything that needs to be said, I agree with essentially all of it.

    Read on →

  • Four lenses on the upsides of bad behaviour

    I’ve been reading quite a few psychiatric/therapeutic/self-help books recently. This post is some notes on a common thread I noticed in a few of them about the positive sides of “bad” behaviours.

    Read on →

  • Elementary programming

    What’s the difference between this program

    mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
    mapMaybe f [] = Just []
    mapMaybe f (a:as) = (:) <$> f a <*> mapMaybe f as 
    

    and this one?

    mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
    mapMaybe = traverse
    

    The second one is certainly shorter, but I believe it would also be considered to be better by many Haskell programmers.

    Read on →