Skip to content

Avoid relying on OccNames when generating class methods#4932

Open
crtschin wants to merge 3 commits into
haskell:masterfrom
crtschin:crtschin/class-placeholders-without-occname
Open

Avoid relying on OccNames when generating class methods#4932
crtschin wants to merge 3 commits into
haskell:masterfrom
crtschin:crtschin/class-placeholders-without-occname

Conversation

@crtschin
Copy link
Copy Markdown
Collaborator

Follows this comment by SPJ.

I'm able to simplify a bit of code following the above comment and using the class type directly instead of going through the binder environment.

  • Keep a interval map for the instances in a module instead of a flat list of binders.
  • Instead of using HieAST to infer the position and finding the instance declaration via AST traversal, use the cached instance map.
  • Remove the hueristics on finding the right binders, by instead taking class methods and instantiating them with the instance types instead.

@crtschin crtschin force-pushed the crtschin/class-placeholders-without-occname branch from de86e29 to a6a081f Compare May 12, 2026 18:44
@soulomoon
Copy link
Copy Markdown
Collaborator

the idea look good to me but I have not have time to review the code yet

@crtschin crtschin force-pushed the crtschin/class-placeholders-without-occname branch from a6a081f to 74680fd Compare May 19, 2026 17:53
@crtschin crtschin changed the title WIP: Avoid relying on OccNames when generating class methods Avoid relying on OccNames when generating class methods May 19, 2026
@crtschin crtschin marked this pull request as ready for review May 19, 2026 17:55
@crtschin crtschin requested a review from wz1000 as a code owner May 19, 2026 17:55
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.

2 participants