Unification (2018)

29 asplake 2 8/18/2025, 7:11:00 AM eli.thegreenplace.net ↗

Comments (2)

primitivesuave · 1h ago
Brought back memories to over a decade ago with Mathematica. It's quite easy to pattern match simple expressions like:

``` expr = foo[bar[k], baz[V]]; expr /. foo[x_, baz[y_]] :> {x, y} ```

But in real-world use cases, this paradigm quickly exposes some unhandled edge cases, or cases where the evaluation becomes prohibitively expensive. Nowadays I use TypeScript, and this has ignited some curiosity into finding out if TS does anything to optimize for this in type inference.

asplake · 1h ago
That’s kinda what brought unification to my attention. For my own education I’m writing a compiler for a simple ML-style language. Enjoying Pierce’s Types and Programming Languages meanwhile.