Skip to content

Implement name-based type checker#96

Merged
purefunctor merged 213 commits intorelentless-type-checkingfrom
justin/name-based-checking
Mar 12, 2026
Merged

Implement name-based type checker#96
purefunctor merged 213 commits intorelentless-type-checkingfrom
justin/name-based-checking

Conversation

@purefunctor
Copy link
Owner

No description provided.

purefunctor and others added 30 commits February 18, 2026 03:40
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
@purefunctor purefunctor force-pushed the justin/name-based-checking branch from 238fb18 to 33edc41 Compare March 10, 2026 20:24
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.
@purefunctor purefunctor force-pushed the justin/name-based-checking branch from 33edc41 to 156763f Compare March 12, 2026 15:42
@purefunctor purefunctor force-pushed the justin/name-based-checking branch from 156763f to 1a2ce37 Compare March 12, 2026 15:44
@purefunctor purefunctor merged commit 3d6ca7b into relentless-type-checking Mar 12, 2026
10 checks passed
@purefunctor purefunctor deleted the justin/name-based-checking branch March 12, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant