Stubbing I/O in Yesod
An easy way to stub I/O actions in Yesod request handler code with dependency injection.
November 5, 2023 | Continue reading →
Haskell Pattern: Design for Qualified Imports
A simple yet thoughtful and robust convention for naming library functions in Haskell.
August 17, 2023 | Continue reading →
Yesod Forms, Newtypes, and Smart Constructors
Yesod form fields operate on primitive types, but you'll want to narrow those types into something more meaningful. Here are a couple of functions you'll need to achieve that.
June 14, 2023 | Continue reading →
Derived Instances Can Break Smart Constructors, Too
Smart constructors help guard against invalid data flowing through your system and prevent the need for more pervasive defensive coding tactics. You just need to be aware of the language details which can circumvent the protection they provide.
June 9, 2023 | Continue reading →
Please Don't Kill Me, Google Maps
In two kilometers, take the exit on the right and then take evasive action from oncoming machine gun fire, comrade.
April 23, 2023 | Continue reading →
Make Your Types Smaller
Persistent models tend to be where primitive obsession creeps in. Make your types more specific so you avoid paying the cost of having to sprinkle validation code throughout your system.
December 31, 2022 | Continue reading →
Make Your Database Tables Smaller
Look for columns that share some narrow domain — narrower than whatever domain is shared by the rest of the columns in that table. Joins are cheap. Expediency is not.
December 28, 2022 | Continue reading →
At Least Assert Your Serialisation Roundtrips
How to use property-based testing with Hedgehog and Hspec to ensure that the values in your system can be serialised and deserialised symmetrically.
December 10, 2022 | Continue reading →
We Deserve Better Than BEM
A simple approach to composing web page components using a compiler and a monadic action. It's easier than BEM, and it works better too.
August 24, 2022 | Continue reading →
Static Asset Hashing in Hakyll
You can do cache-busting of static assets in a Hakyll website by generating a hash of the file's contents and using that as the path to the compiled asset instead.
August 18, 2022 | Continue reading →
Solving a Maths Riddle with Bad Haskell
Sometimes you need to get some quick and dirty scripting work done. Sometimes Haskell is an excellent tool for this.
May 3, 2022 | Continue reading →
Fast Counting with PostgreSQL and Haskell
You can abuse the query planner in PostgreSQL to drastically improve performance when counting records in large tables, although it takes some finesse to implement this with Persistent and Esqueleto — two Haskell libraries for database access.
December 24, 2021 | Continue reading →
Why We Don't Do Daily Stand-Ups at Supercede
A hard look at the motivations for — and inevitable realities of — the Cult of Agile daily stand-up. This toxic workplace ritual is designed to demoralise engineers and perpetuate micromanagement. Stop doing them.
August 30, 2021 | Continue reading →
20% Time at Supercede
Software development is all about discovery and invention, and it'd be foolish for a business to relegate that time to evenings and weekends. At Supercede, we set explicit work time for this every week.
June 23, 2021 | Continue reading →
How I Write Elm Applications
This covers a few patterns that I often lean on when writing non-trivial single-page applications in Elm. The bulk of this is breaking apart the application state, and then traversing it with lenses.
November 7, 2020 | Continue reading →
Why I Love Monday Mornings
An exercise in gratitude and inclusivity. An explicit, recurring opportunity for everyone on the team to speak up. It costs nothing, and yet it changes everything. Try it!
May 22, 2020 | Continue reading →
How I Work From Anywhere in the World
There are many wonderful places to be in the world, but few that are nice to be in year round, at least in terms of climate and economics. I'm using a few specific tools to help navigate this.
February 2, 2020 | Continue reading →
Rewriting Routes in Yesod
Routes that are clear and comprehensible to the user are fundamental to good web application design. With a bit of care, we can tidy up some routes that would typically be noisy in a Yesod application.
January 22, 2020 | Continue reading →
Bleep. Bloop. I Am Approving Your Transaction.
Sometimes what you really need in your software system is a helping hand from a tiny robotic friend.
October 5, 2019 | Continue reading →
On Technical Debt
October 4, 2019 | Continue reading →
Implementing a Content Security Policy in Yesod
September 21, 2019 | Continue reading →
Tracing User Requests in Yesod
July 9, 2019 | Continue reading →
Rich Hickey Doesn't Know Types
Sorry Rich, typing preferences are one thing, but the implication that parametricity is effectively useless is just a bridge too far. You can't expect to say something wrong on the Internet and get away with it!
April 9, 2019 | Continue reading →
You Think CSS-in-JS is Bad?
Yes, web development really was this crazy a decade ago. And this only scratches the surface!
January 30, 2019 | Continue reading →
Hello World in Haskell
January 27, 2019 | Continue reading →
Keeping CSS Simple
Modern CSS tooling gives you so much added power. But are you sure it's more power that you want? Perhaps it's time we stop digging ourselves a deeper hole.
January 12, 2019 | Continue reading →
Silence, At Last
December 14, 2018 | Continue reading →
Yesod is a Minimal Web Framework
December 13, 2018 | Continue reading →
February 1, 2017 | Continue reading →
The Knowledge Is A Scam
January 30, 2017 | Continue reading →
Showing The Weather In Tmux
Bash scripting for fun and profit. And the weather, obviously.
September 23, 2016 | Continue reading →
Git Is Your Single Point Of Truth
Not all project management tools are created equal, and most of them are fundamentally flawed with regards to one of the most important aspects of a software development project. Here's one that isn't.
August 19, 2016 | Continue reading →
Some fuel to stoke the flames of the language wars.
May 28, 2016 | Continue reading →
Working In The Dark
It's not uncommon to work unsociable hours, be that because of deadlines, midnight inspiration, or just skipping a few timezones. But that doesn't mean your eyes have to suffer. Here's how I protect mine.
March 6, 2016 | Continue reading →
Deploying A Haskell Web Service With Nix
The entire process from zero to “Hello, Haskell!” running on a cheap Amazon EC2 instance.
February 1, 2016 | Continue reading →
The Case Against Dynamic Typing
You can have your cake, you can eat your cake, and you can automatically verify the fundamental correctness of the pâtisserie at bake-time.
January 26, 2016 | Continue reading →
Code Review Done Right
Code review is an oddly bureacratic process for a team of software developers to follow. What follows are my non-technical thoughts on conducting constructive, humane reviews of code.
November 24, 2015 | Continue reading →
My Uncomplicated Git Workflow
Stop screwing around with version control ceremony and learn to love Git from the command line.
November 12, 2015 | Continue reading →
The World's Most Boring Build System
November 11, 2015 | Continue reading →
Visualising Code Growth with Git and D3.js
October 25, 2015 | Continue reading →
Using Git to Manage Todos
The TODO comments in your codebase will linger and rot, but this small bash script will coerce your team into cleaning up after themselves.
October 19, 2015 | Continue reading →
How I Write Invoices in Vim
I use Vim for writing code, composing emails, taking notes, and just about everything. It makes sense to use it for building business paperwork too.
September 5, 2015 | Continue reading →
How I Find and Replace in Vim
A simple and effective way to find and replace across an entire project with plain Vim, without plugins.
September 2, 2015 | Continue reading →
Automatic Quality Assurance with Git Hooks
How to use a pre-commit hook in Git to make sure every commit passes all tests and style checks.
June 22, 2015 | Continue reading →
Moving to the Beginning of the Line
A nice little Vim function that moves the cursor to the first non-whitespace character on the current line, or the first column if it was already on the first character.
May 26, 2015 | Continue reading →
Shell Script Static Analysis in Vim
How to configure Vim to provide immediate feedback on the quality of your shell scripts.
May 17, 2015 | Continue reading →
Free Internet on Trains
A bash function for changing your MAC address on OSX which usually works around Internet access time limits on public WiFi hotspots.
May 7, 2015 | Continue reading →
Working with Whitespace
A couple of tips for weeding out trailing whitespace and unnecessary blank lines in Vim.
December 21, 2014 | Continue reading →
Folding Paragraphs in Vim
Tame hairy text files with a fold expression.
October 29, 2014 | Continue reading →
Red, Green, WTF?
May 8, 2014 | Continue reading →
A visualisation experiment in Sass using loops and animation.
December 9, 2013 | Continue reading →
Animating the border-radius property with CSS3 for fun and profit.
August 8, 2013 | Continue reading →
A brief overview of the hardware and software I use to Get Stuff Done™.
July 2, 2013 | Continue reading →