Haskell koan: Type-checked non-empty strings

A Bellroy engineer shows Haskell rejecting empty string literals at compile time.

Author
Mike Ledger, Bellroy
Published
23 June 2026
Kind
Company engineering blog post, with code and one build-time figure
Original
exploring-better-ways.bellroy.com/haskell-koan-type-checked-non-empty-strings.html
Subject
Programming languages and types

What it is

Mike Ledger writes on the Bellroy engineering blog. The post presents a small, uncommon technique the team uses and enjoys. It explains the code step by step and shows where it stops working.

What it says

What evidence it gives

The post gives code at each step. It reports one result: about 10% less compile time. No benchmark method is shown.

Interests and limits

Bellroy is the author's employer, and the post describes its own practice. The build-time figure comes from one package and is stated loosely. The technique needs a recent compiler and UndecidableInstances.