Skip to content

Give GadtConstraint a nicer toText #16085

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

Merged
merged 2 commits into from
Oct 3, 2022
Merged

Give GadtConstraint a nicer toText #16085

merged 2 commits into from
Oct 3, 2022

Conversation

dwijnand
Copy link
Member

Instead of showing the underlying constraint info, which just looks bad,
takes up lots of space, and shows details that aren't relevant and often
includes leaked type constructors, just show the symbols and their full
bounds, nice and compact. And do that as a part of toText instead of
having a side "debugBoundsDescription" alternative.

Instead of showing the underlying constraint info, which just looks bad,
takes up lots of space, and shows details that aren't relevant and often
includes leaked type constructors, just show the symbols and their full
bounds, nice and compact.  And do that as a part of toText instead of
having a side "debugBoundsDescription" alternative.
@dwijnand dwijnand marked this pull request as ready for review September 22, 2022 07:23
@dwijnand dwijnand requested a review from Linyxus September 30, 2022 09:19
Copy link
Contributor

@Linyxus Linyxus left a comment

Choose a reason for hiding this comment

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

Nice! GadtConstraint.toText gives us an indeed compact and concise view of the constraints. It is easy-to-read and reduces the noises.

However, hiding the underlying Constraint from the text still loses information about GADT. The internal constraint state of GADT helps us understand the things better. Importantly, the OrderingConstraint representation of GADT shows the ordering between constrained parameters and the concrete type bounds differently. Such information may still be useful when tracing some complicated problems or implementing new features. Therefore, I'd suggest that
we could keep the debugBoundsDescription method for possible future usage (or maybe commenting it out?).

@dwijnand
Copy link
Member Author

dwijnand commented Oct 3, 2022

Sure, no problem.

@dwijnand dwijnand requested a review from Linyxus October 3, 2022 08:03
Copy link
Contributor

@Linyxus Linyxus left a comment

Choose a reason for hiding this comment

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

LGTM!

@dwijnand dwijnand merged commit fde2189 into scala:main Oct 3, 2022
@dwijnand dwijnand deleted the gadt-text branch October 3, 2022 09:43
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