2 ms·
Nice. Last November I wrote a implementation of a type checker for the STLC in typescript using mogensen-scott encoding. The idea is that data is represented b
by dunham 2y ago
Nice. Last November I wrote a implementation of a type checker for the STLC in typescript using mogensen-scott encoding. The idea is that data is represented by its eliminator, so you kind of get pattern matching in javascript.
I had been playing around with the idea and thought I'd try a larger example to see how painful it was to work with. I don't think I would build anything bigger with that technique, though.
https://gist.github.com/dunhamsteve/1be0cbb346d75ee1be8f67d192e73234 https://gist.github.com/dunhamsteve/1be0cbb346d75ee1be8f67d1...