Skip to content

Conversation

@nikomatsakis
Copy link
Contributor

Refactors how the Folder is setup:

  • Simpler trait setup: Instead of having a ton of small traits, we have one larger trait with default methods
  • Documented, at least somewhat, in the chalk book
  • Now permits "overriding" the handling of goals and clauses

The motivation for this work is to work towards the "syntactic equality" goal, where we desugar aliases into a combination of an inference variable and an alias goal ahead of time, rather than building "rich type equality" into the solver itself.

Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I like this; cleans up this quite a bit. That as_dyn is a bit ugly, but not sure there's a way around that.


/// Folding a goal invokes the `fold_goal` callback (which will, by
/// default, invoke super-fold).
impl<TF: TypeFamily, TTF: TargetTypeFamily<TF>> Fold<TF, TTF> for Goal<TF> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this from boring_impls?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not boring. It invokes a callback on folder rather than just recursively reproducing its structure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this naming scheme isn't obvious to everyone else though. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, my thought for "boring" is either boilerplate-like code or code that is extremely simple.

@nikomatsakis
Copy link
Contributor Author

OK, @jackh726, I think I addressed all your comments.

@jackh726
Copy link
Member

jackh726 commented Feb 8, 2020

Yeah, LGTM

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