-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
generalize internal representation of generic types
All types that have type variables are now represented as a GenericType record, which holds a non-generic Type and an array of type arguments. This change is because originally we only cared about generic records and generic functions, but once we have the `local type MyType<T> = ...` syntax, other types can be generic as well (in particular, unions). Instead of replicating generic support logic in the implementation of each type, we factor it out into a type-level term which encapsulates the application of type variables, which is something more like second-order lambda calculus. See https://en.wikipedia.org/wiki/System_F and the ensuing rabbit hole.
- Loading branch information
Showing
5 changed files
with
987 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.