https://github.com/wdamron/poly
Hindley-Milner type system with extensible records and variants, implemented in Go
https://github.com/wdamron/poly
algorithm-w hindley-milner type-inference type-system type-theory
Last synced: 8 months ago
JSON representation
Hindley-Milner type system with extensible records and variants, implemented in Go
- Host: GitHub
- URL: https://github.com/wdamron/poly
- Owner: wdamron
- License: mit
- Created: 2019-04-03T06:55:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-21T02:47:49.000Z (about 5 years ago)
- Last Synced: 2025-04-05T21:34:06.073Z (9 months ago)
- Topics: algorithm-w, hindley-milner, type-inference, type-system, type-theory
- Language: Go
- Homepage:
- Size: 185 KB
- Stars: 21
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# package poly
```go
import "github.com/wdamron/poly"
```
`poly` provides inference for a polymorphic type-system with extensible records and variants.
The type-system is an extension of [Hindley-Milner](https://en.wikipedia.org/wiki/Hindley–Milner_type_system) based on Daan Leijen's paper: [Extensible Records with Scoped Labels (Microsoft Research)](https://www.microsoft.com/en-us/research/publication/extensible-records-with-scoped-labels/).
The core of the implementation is based on an [OCaml library](https://github.com/tomprimozic/type-systems/) by Tom Primozic.
## Supported Features
* Extensible records and variants with scoped labels
* Generic type classes, constructor classes, and parametric overloading
* Limited/explicit (type class) subtyping with multiple inheritance
* Mutually-recursive (generic) function expressions within grouped let bindings
* Mutually-recursive (generic) data types
* Transparently aliased (generic) types
* Control-flow graph expressions
* Mutable references with the [value restriction](https://en.wikipedia.org/wiki/Value_restriction)
* Size-bound type variables
## More Info
* Docs (Godoc)
* [`poly`](https://godoc.org/github.com/wdamron/poly)
* [`poly/ast`](https://godoc.org/github.com/wdamron/poly/ast)
* [`poly/types`](https://godoc.org/github.com/wdamron/poly/types)
* [extensible_rows2 (OCaml implementation)](https://github.com/tomprimozic/type-systems/tree/master/extensible_rows2)
* [Extensible Records with Scoped Labels (Leijen, 2005)](https://www.microsoft.com/en-us/research/publication/extensible-records-with-scoped-labels/)
* [Efficient Generalization with Levels (Oleg Kiselyov)](http://okmij.org/ftp/ML/generalization.html#levels)
* [Hindley-Milner type system (Wikipedia)](https://en.wikipedia.org/wiki/Hindley–Milner_type_system)