Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bynect/algorithm-w
Type inference implementation in OCaml using Algorithm W
https://github.com/bynect/algorithm-w
functional-language functional-programming hindley-milner ocaml type-inference type-system
Last synced: 12 days ago
JSON representation
Type inference implementation in OCaml using Algorithm W
- Host: GitHub
- URL: https://github.com/bynect/algorithm-w
- Owner: bynect
- License: mit
- Created: 2021-08-21T15:27:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-26T10:27:28.000Z (over 3 years ago)
- Last Synced: 2024-11-19T12:15:46.787Z (2 months ago)
- Topics: functional-language, functional-programming, hindley-milner, ocaml, type-inference, type-system
- Language: OCaml
- Homepage:
- Size: 58.6 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Algorithm W implementation
The implementation is based on the paper [Algorithm W Step by Step][algo-w],
with the addition of n-tuples, custom operators and if expressions.## Grammar
```txt
exp ::= x -- variable
| exp exp -- application
| exp `x` exp -- infix application
| exp op exp -- infix operation
| fun x0...xn -> exp -- anonymous function
| let x = exp in exp -- let binding
| if exp then exp else exp -- if expression
| exp, exp -- tuple
| i -- int literal
| b -- bool literal
| exp :: ty -- type annotationty ::= a0...an
| int
| bool
| unit
| ty -> ty
| ty * ty
```## References
* [Algorithm W Step by Step][algo-w]: Original paper
* [Write you an inference in F#][fsharp]: Various type inference algorithm implemented in F#[algo-w]: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.65.7733&rep=rep1&type=pdf
[fsharp]: https://github.com/7sharp9/write-you-an-inference-in-fsharp