4 ms·
I recommend the paper "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism" by Dunfield and Krishnaswami. It describes an easy to implemen
by labbekak 9y ago
I recommend the paper "Complete and Easy Bidirectional Typechecking
for Higher-Rank Polymorphism" by Dunfield and Krishnaswami. It describes an easy to implement algorithm for type inference for higher ranked types that can subsume Hindley-Milner.
Implementation in Haskell: https://github.com/ollef/Bidirectional https://github.com/ollef/Bidirectional
Implementation in Javascript/Typescript (by me):
https://github.com/atennapel/bidirectional.js https://github.com/atennapel/bidirectional.js
- yorwba 9y agoArXiv link for the paper: https://arxiv.org/abs/1306.6032 https://arxiv.org/abs/1306.6032
- cf 9y agoYour comment expanded out is what I had hoped that blogpost would have been. Thank you for posting this. It's hard to overstate how much easier bidirectional typechecking is compared to other approaches. My favorite starting point is actually Dunfield's lecture notes on bidirectional type checking, https://people.mpi-sws.org/~joshua/bitype.pdf https://people.mpi-sws.org/~joshua/bitype.pdf The paper you mentioned is great at showing the approach scales well to giving you all the fancy features you might want that are in modern languages.