https://github.com/yiyunliu/bidirectional-tc
https://github.com/yiyunliu/bidirectional-tc
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yiyunliu/bidirectional-tc
- Owner: yiyunliu
- License: bsd-3-clause
- Created: 2019-11-03T00:11:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T03:26:04.000Z (over 5 years ago)
- Last Synced: 2025-02-15T22:28:36.911Z (4 months ago)
- Language: Haskell
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# bidirectional-tc
A Haskell implementation of the type system described in the paper [Let Arguments Go First](https://link.springer.com/chapter/10.1007/978-3-319-89884-1_10).This project is purely for learning purposes, since I have never implemented a serious typechecker.
ArgFirst.hs is the old version, which uses the Barendregt convention to prevent accidental capturing. The variables are all named. There are a couple of functions which does some preprocessing to ensure that the names are distinct before entering the inference monad.
ArgFirstB.hs, the newer version, uses the [bound](https://hackage.haskell.org/package/bound) package for the lambdas and foralls. The opening of scopes still follows the Barendregt convention. Overall, I find this approach much more robust than my handwritten one.
I haven't written many tests yet. As of now, church numerals and pairs all typecheck. Instantiantion of a polymorphic function at multiple call sites with different argument types also seem to work.