Hero image for "Idris Doesn't Prove Your Program Correct. It Makes the Wrong Ones Impossible to Type."

Idris Doesn't Prove Your Program Correct. It Makes the Wrong Ones Impossible to Type.


Picture a type error that isn't about a missing semicolon or a mismatched string. Picture one that tells you: you swapped two variables that happen to both be the number of elements in a list. That's the kind of mistake Idris catches — not because it ran your code, but because the type itself encoded the shape of the answer before you wrote a single line. A documented debugging session with Idris's length-indexed vector type Vect n a shows exactly this: a developer writing a split function accidentally passed n where m belonged, and the compiler rejected the call outright, because the return type computed from that swap didn't match what the function signature promised (HourTab).

That's a small example, but it's the whole argument for dependent types in one line of rejected code.

A Different Question Than Lean or Rocq Are Asking

It's easy to lump Idris in with the heavyweight proof assistants — Lean, Rocq, Agda — because they all let types depend on values. But a recent comparison of proof-oriented tools makes a useful distinction: some of these systems exist to prove mathematics or model distributed systems, and some exist to let you write ordinary programs whose types happen to be precise enough to rule out whole categories of bugs. Idris 2 shows up in that same table of fifteen verification tools, but it sits closer to "programming language with a powerful type system" than "proof assistant that happens to run code" (Dbggr).

That distinction matters more than it sounds. A recent academic study — a grounded-theory interview project with people who actually use dependently typed languages day to day (Agda, Rocq, Lean) — found that practitioners use types primarily to plan and constrain their programs, and that they treat the compiler as an iterative collaborator rather than a one-shot verifier (TU Delft). That's Idris's whole design bet: dependent types aren't primarily a tool for writing Fermat's Last Theorem in machine-checked form. They're a tool for making the compiler your pair programmer on ordinary code, catching the kind of logic error that unit tests only catch after you've already shipped it.

Totality Isn't a Nice-to-Have — It's Idris Refusing to Let You Lie About Coverage

The Vect n a example only tells half the story. The same debugging session documents a second failure mode: a function written to accept a non-empty vector (Vect (S n) a, meaning "successor of n," i.e., at least one element) that still got rejected by Idris's totality checker, because the pattern match didn't visibly account for every case the type theoretically allowed (HourTab). Idris's total keyword isn't decoration. It's a standing demand that every function either covers all its cases or explicitly admits it might not terminate. Most languages let you write a partial function and discover the gap in production. Idris asks you to resolve the gap before the function compiles.

Erasure: The Proofs Disappear, but Only After They've Done Their Job

The other half of Idris's design is quieter but just as deliberate: not every dependent type you write needs to survive into the compiled binary. Idris 2's quantitative type theory (QTT) tags each argument with how it's used — erased, used exactly once, or used freely — so that proof-level arguments that exist only to satisfy the type checker vanish from the runtime code entirely. That idea is influential enough that an unrelated project building its own observational type theory kernel cites Idris 2's QTT directly as the model for how quantities should gate what survives to the backend (GitHub). The pitch is that you get compile-time guarantees without paying for them twice — once in development, once in runtime overhead.

Why This Matters More Right Now, Not Less

Formal verification is suddenly flush with money and ambition — AI-driven projects are now machine-checking hundreds of millions of lines of proof code in Rocq and Lean at an industrial scale that was unthinkable even a few years ago (SIGPLAN Blog). That's a genuinely different project from what Idris set out to do. The industrial verification wave is about bolting rigor onto existing code after the fact, often with an AI agent doing the proving. Idris's older bet was narrower and, I'd argue, more durable for working programmers: put the proof obligation in the type signature from the start, so the wrong program never compiles in the first place. You don't need a verification budget measured in millions of dollars to benefit from that. You just need a function signature that refuses to lie to you about what it returns.