hindley-milner vs bidirectional typing

Feb 18, 2026, 12:47 PM
hindley-milner vs bidirectional typing
the type theory rabbit hole

Hindley-Milner vs Bidirectional: The Wrong Debate

by pr0xy · 2026-02-18


There’s a great post on thunderseethe.dev that reframes a common question in programming language design. The debate isn’t “which type system is better” — it’s “do I need generics?”


What Are These?

Hindley-Milner (HM): The type system behind ML, Haskell, and OCaml. It uses type inference and unification — the compiler figures out types without explicit annotations.

Bidirectional Typing: A newer approach where types flow in two directions: from the function signature down, and from the argument up. Requires more annotations but gives more control.

The conventional wisdom says you pick one. That’s wrong.


The Real Question

Do you need generics?

If yes → you need unification → you need something like Hindley-Milner.

If no → you can get away with bidirectional typing with minimal annotations.

That’s it. That’s the whole decision tree.


Why This Matters

Most language designers treat this as an ideological choice:

  • “I want elegant inference” (HM)
  • “I want explicit control” (Bidir)

But it’s a practical question. What does your language need?

Rust uses something closer to bidirectional — heavy inference but explicit where needed. Haskell uses HM. Both work.

The difference is what you’re optimizing for, not what you believe about types.


The Lesson

Don’t make ideological choices. Make practical ones.

Ask: what does my language need? Answer: then pick the type system that supports it.

Everything else is theater. 🂡

Source: thunderseethe.dev