Welcome to Foldl

What’s a foldl?

Also known as reduce or accumulate, folds are a family of a higher-order function that traverse a data structure and “compresses” it into a new value. foldl is the left fold function, which works from the left-hand side of the data structure towards the right, accumulating a result as it goes.

As for this website, it’s where I host my writing about programming and management.

June 5, 2023

Working with me

Welcome to my manager README. This is a guide to working effectively with me. My role What do I value most? What will disappoint me? How do I work? How do I expect you to work? Nuances to working with me Motivation for this document This document should help establish a foundation so can work together effectively (if it doesn’t please let me know). Consider this document an introduction to how I work, what I value, and some of my mental models.
February 6, 2022

Same problem, different language

Different languages have different strengths and weaknesses, which makes solving certain types of problems easier or more difficult. This post explores the different levels of abstraction commonly used in Ruby vs. Haskell. Typical Haskell code uses a much higher level of abstraction, making the code terse but also difficult for newcomers to understand. On the other hand, Ruby - while not an exceedingly verbose language - is usually written with a lower level of abstraction, making it more accessible yet harder to maintain due to it’s lower abstraction level.
January 9, 2022

Asking useful questions

In this post I explain why some questions are more useful than others, and how to ask better questions. Asking excellent questions is an important skill that improves the outcome for anything you work on. The best questions are specific, leverage existing mental models, yet force you to think beyond what you currently know by evaluating problems from different perspectives. How do good questions improve the outcome for anything you work on?
December 30, 2021

Serendipity is a bug

Think of a time when you were walking in the hallway or grabbing coffee in the kitchen and chanced upon colleagues discussing a project that impacted you, which you were previously unaware of. Learning about the project is great, but it’s hard to argue that this sort of chance encounter is a good way to learn important information. In this post, I explain how serendipitous communication is an organizational bug and point out an approach that improves how information flows in your organization.
May 31, 2021

Skolem and existential types

In this post I explain what skolem variables are and how they relate to existential quantification. After reading this, you should have an intuition for how skolems work and why existential types are a natural extension from skolems. Lots of talk about existential types lately A couple of months ago a coworker of mine gave a talk on using existential types to address the expression problem. The talk was great and engaging, and provided a nice refresher on working with existentials - this isn’t something I use daily.
May 11, 2021

Build your very own ban hammer

In this post, I describe how to implement a ban button in a web application with minimal boilerplate. This is one of those features that shouldn’t be used often, but when you need it, you need it. The requirements for a useful user ban are simple and straightforward; prevent them from doing anything else on the application. You can break that down into two parts. First, prevent them from doing anything else right now.
May 1, 2021

Using D3 on Hugo pages via Shortcodes

In this post, I explain how to easily embed one or more D3 visualizations directly into Hugo page content. Embedding D3 content Hugo posts with Shortcodes Using D3 on any page requires loading the D3 library and a script containing the D3 code you want to run. Both of those tasks require adding <script> tags to the page, so you’ll need some way to add a pair of script tags. Additionally, you probably don’t want the D3 code to mount its visualization directly to the page’s body, so you’ll need a target element somewhere in the DOM.
April 15, 2021

Understanding variability in Heroku dyno performance

Heroku is a great platform if your app conforms to their expectations, but their dyno abstraction is somewhat leaky. It is surprisingly easy to deploy an application that behaves differently than you’d expect despite their documentation’s warnings about shared CPUs. In this post, I share some research on the performance/behavior of their various dyno classes and how I think about selecting dynos for different workloads. If you’re familiar with Heroku’s platform, I suggest skipping ahead to exploring CPU-intensive workloads.
November 13, 2020

Debugging Page Rendering

Debugging rendering issues is a bit of a black art. Doing so effectively requires understanding the browser’s critical rendering path along with how to use a sufficiently powerful debugger. This article aims to explain the basics of the critical rendering path - although there are far better resources available - as well as how to use Chrome’s debugger to identify the issue. A primer on the Critical Rendering Path After your browser requested this webpage it began a complex dance between three interconnected processes in order to process the HTML & ultimately render a page in the browser window.
September 26, 2020

Hiring Specialists

In this post I want to talk about how to hire novel specialists. There have been thousands of pages already written on hiring in-general, and I don’t have anything to add there. However, twice in my career I’ve needed to hire a novel specialist into the organization to bring in new skills. I’m defining novel to mean: someone with highly technical skills that your current organization does not have the capability to evaluate effectively.
March 31, 2020

Hunting for a match

This post continues the series of interview problem breakdowns. In this series, I attempt an interview problem from somewhere on the internet that I have never seen before and share all the details with you. I set a limit of one hour for the initial attempt, then follow up with a correct solution regardless of how long it takes. Hunting for a match With all the changes and a new schedule for my toddler its been difficult to find the time to work on these challenges In fact, this is the first problem I’m attempting under “lockdown”.
March 12, 2020

Chaotic arrays

This post continues the series of interview problem breakdowns. In this series, I attempt an interview problem from somewhere on the internet that I have never seen before and share all the details with you. I set a limit of one hour for the initial attempt, then follow up with a correct solution regardless of how long it takes. Unwinding chaotic arrays I went through this problem back in late February, but with COVID-19 its been difficult find the time for reflection and documenting my attempt.
March 3, 2020

Hunting for Triplets

This post continues the series of interview problem breakdowns. In this series, I attempt an interview problem from somewhere on the internet that I have never seen before and share all the details with you. I set a limit of one hour for the initial attempt, then follow up with a correct solution regardless of how long it takes. Finding Geometric Triplets This was a fun problem. Implementing something that worked was simple, but finding the correct solution took a change in perspective and deeper insight into the problem.
February 17, 2020

Special Strings

This is the first in a series of posts where I’ll introduce an interview problem I’ve never solved before and attempt to solve it in an hour. I’ll show what was achieved in that hour, then proceed to implement a full solution to the problem if I failed to initially do so. Counting Special Strings The problem Via HackerRank, this problem asks us to solve the following: A string is said to be a special string if either of two conditions is met:
February 12, 2020

Sorting surprise

tl;dr; Checking your invariants matters. It’s easy to write code that violates an invariant if you’ve forgotten to verify it. When in doubt, make the constraints and assumptions you are working within explicit rather than implicit. This will help future-you avoid all sorts of pain. The Classic Missed Invariant Have you ever seen a test fail in CI or a function fail in production only to have a teammate (or yourself) declare “… but it works on my local!
January 18, 2020

Finally, application config management you can live with

Today I want to talk about the least-exciting part of developing an application, configuration. All those pesky little details that change across environments, or might change. You’ve done the smart thing and factored them out into environment variables, or key-value-pairs in a configuration file, etc… And now your application’s code is clear and concise, and works great when you flip between production and development mode. However, there’s still one unanswered question - where do you actually store all of this configuration?
June 27, 2019

Reading List

Over the past month or two I’ve had several conversations with teammates where they’ve asked for my “reading list”. I read a lot, but there isn’t anything particularly special about the books I read. That being said, books are wonderful and always worth sharing, so here are the things I’ve read that have made a big impact on me. They’re mostly professional, but there are a few mind-expanding books thrown in for good measure.
June 10, 2019

Algo Study: Evolving N Queens

The problem at hand Welcome to “algorithm study”, a fancy name for my fiddling with solutions to classic problems in computer science. Many of these problems will be NP-Complete or NP-Hard, so while there may be no polynomial solution, its still often possible to create reasonably performant solutions for small values of n. The series will work through things like path finding, Sudoku solvers, N-Queens, and others in an iterative fashion.
April 29, 2019

Beware the consequences of Peak-End Rule

At work we’ve recently changed how we execute software projects in an effort to dramatically shorten the feedback between work & learnings gleaned from that work. However, as with any sort of transition, there’s a body of work that has recently been wrapping up. Amongst this work were a pair of quarter-long projects that had very different execution stories & completion states. I’ll be using these two projects (in the abstract) to explain Daniel Kahneman Et Al.
April 1, 2019

Generating Ordered Permutations

I’ve been reading a lot lately about the early days of computers & hacker culture. Each of the books has highlighted how important having a deep understanding of the tools & hardware has been for programmers, regardless of generation. Personally, I’ve been fortunate enough to spend my entire career working with relatively high-level languages like Scala, Haskell, or even C#. Tools like those allow programmers to be extremely productive without ever really grasping the inner workings of their machine.
March 10, 2019

Fixpoints and the Y combinator

What’s a Fixpoint? For some reason, functional programming seems to have developed a reputation for using confusing and/or complex names to describe various concepts. I recall this being more or less my impression as I transitioned from the “standard” OOP+imperative style into functional programming, so I’d like to start dispelling some of the confusion. This piece will talk through one of the basic, albeit more obscure, building blocks for functional programming that was a bit intimidating upon my first contact with it.
January 27, 2019

Cuckoo Filter: Part 2

The API Due to the way buckets are maintained in cuckoo filters its possible to perform the three basic set operations, insert, delete, and member. Those three operations comprise the api into Data.CuckooFilter in the cuckoo-filter library package. As you’d expect for a data strucure that answers set membership questions, the API behaves exactly like the api for a set, with one big exception. As discussed in part 1, cuckoo filters (and cuckoo hashing in general) store fingerprints in hash buckets.
January 20, 2019

Cuckoo Filters: Part 1

Approximate Set Membership Several years ago I was hard at work building a near-realtime database of events happening around the world. This was a classic crawling problem, where I’d need to make sure I’m not checking the same location for events twice, or looking for events hosted by the same person twice. Initially the team and I were able to get away with using a regular Set for this, but as we scaled up to handle millions of sources this approach broke down.
January 13, 2019

Tricky Functor instances

I was recently started reading Thinking with Types and came upon a great explanation of variance and the role it plays in reasoning about functions. You’re probably familiar with Functor, which says that for some t a, if given a function f :: a -> b, you can transform the t a -> t b. Essentially, the essence of “functor-ness” is the ability to transform a result into another type. What about “anti-functorn-ness”, where you want to transform the input rather than the result of a function from a -> b?
November 10, 2018

Introduction to Untyped Lambda Calculus

A few weeks ago I gave a talk at work about Lambda Calculus. I had intended to speak only about the Y-combinator (post about that is forthcoming), but ended up spending two-thirds of my time rushing through an explanation of the untyped Lambda Calculus. Afterwards a few teammates suggested that the material in that talk would be better served with a blog post, so here we are. The untyped lambda calculus isn’t particularly useful for day-to-day programming unless you happen to work in language design, but its fascinating and well worth a trip down the rabbit hole.
June 3, 2018

About

I’m a programmer fascinated by typed functional programming. I also happen to be a father, rock climber, and engineering manager at a startup. I’ve been working in tech for 15 years in a number of roles. Along the way I’ve made more mistakes than I can remember, built some exciting products, and learned a few things. Writing helps me think, and this blog is a tool for exploring questions I find interesting.
January 1, 1