Implement name-based type checker#96
Merged
purefunctor merged 213 commits intorelentless-type-checkingfrom Mar 12, 2026
Merged
Conversation
Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Amp <amp@ampcode.com>
This is a non-standard extension to PureScript that would enable
checking for the representation that we'll be using for instance
dictionaries. For example, we plan to represent the following:
class F :: forall k. (k -> Type) -> Constraint
class G :: forall k. (k -> Type) -> Constraint
instance (F f, G f) => (Compose f g)
forall
{fk gk}
(f :: fk -> Type)
(g :: gk -> Type).
F f =>
G f =>
Compose f g
238fb18 to
33edc41
Compare
The test case demonstrates unification errors that come from failed promote_type checks when trying to solve unification variables against rigid type variables that came from the instance head canonical.
This fixes the 228 test case by introducing a proper instantiation step for rigid type variables from the instance head canonical. This creates fresh rigid type variables with update depths, fixing issues with the escape check in promote_type and subsequently, unification. This also changes the representation of Bindings::implicit to be based on Vec instead of HashMap. This enables trivial shadowing, ensuring that implicit type variables are kept up to date after instantiation.
33edc41 to
156763f
Compare
156763f to
1a2ce37
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.