Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,252
    • Issues 5,252
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 561
    • Merge requests 561
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Merge requests
  • !4149

Don't replace type family applications with flattening variables

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Richard Eisenberg requested to merge wip/cfuneqcan-refactor into master Sep 26, 2020
  • Overview 263
  • Commits 4
  • Pipelines 61
  • Changes 130

This large patch simplifies the flattener used during constraint solving. Instead of creating flattening-metavariables (fmvs) and flattening-skolems (fsks), this just reduces type family applications directly. The biggest challenge is that, now, we need to be able to rewrite type family applications, not just variables. Still, this is a nice net win over the previous state of things.

Looking at the lines of this patch, the majority are just module shufflings. This was made necessary by moving the core flattener (distinct from the type-inference flattener) from FamInstEnv into Unify. The change is necessary because we now use the core flattener when looking up class instances, too (to detect that e.g. C [a] "unifies" with C [F b]). Sadly, moving the core flattener also required breaking up GHC.Core.Map into GHC.Core.Map and GHC.Core.Map.Type, avoiding module cycles with GHC.Core.

A good place to start is in GHC.Tc.Types.Constraint, where the new CEqCan canonical constraint is introduced, along with CanEqLHS, where the latter is a new datatype that represents either a variable or a type family application.

Edited Nov 26, 2020 by Richard Eisenberg
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: wip/cfuneqcan-refactor