Skip to content

Instantly share code, notes, and snippets.

@Plecra
Plecra / typing_rules.md
Last active January 5, 2026 05:06
A rundown of typing rules a la Rust

How to read typing rules, by Rust intuition

This is just a brief little walkthrough of how to interpret the simplest typing rules, by presenting them as Rust types to appeal to what you already know. There's plenty uncovered, but this should get you off to a great start!

(I originally wrote this in response to a particular question, so it's a little targeted. Anyone is very welcome to suggest edits, I might come by and fix it up later)

We want typing contexts because some expressions have free variables. To know the type of (x, y),