Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalise macro type-checking #296

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Generalise macro type-checking #296

wants to merge 2 commits into from

Commits on Nov 20, 2024

  1. Generalise macro type-checking

    This commit generalises macro type-checking, making class constraints
    more general by allowing what GHC calls FlexibleContexts and
    FlexibleInstances.
    
    Key changes:
    
      - A special monad for solving, TcSolveM.
        This monad keeps track of a work list and a set of
        inert (= fully processed) constraints.
    
      - Solving a constraint using a top-level instance may now add
        additional constraints to the work list.
    
      - Instances are keyed using a TrieMap, similar to GHC's RoughMap,
        which avoids traversing all instances when doing instance matching.
    sheaf committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    61fb355 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2024

  1. Macro typechecker: improve treatment of equalities

    The solver didn't handle equalities properly, as it didn't account for
    the result of unification. Now, we try to unify, and if the unifier
    makes no progress we make the constraint into an inert constraint.
    sheaf committed Nov 21, 2024
    Configuration menu
    Copy the full SHA
    646b51e View commit details
    Browse the repository at this point in the history