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

Add termTypePrec to TermLiteral to allow for TermLiteral SNat #2329

Merged
merged 3 commits into from
Sep 15, 2022

Conversation

martijnbastiaan
Copy link
Member

For #2270

Still TODO:

  • Write a changelog entry (see changelog/README.md)
  • Check copyright notices are up to date in edited files

Copy link
Member

@DigitalBrains1 DigitalBrains1 left a comment

Choose a reason for hiding this comment

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

I think this is going to mention a bunch of things you already fixed... because I started the review on an older version and after pressing "Refresh" it says I have 7 comments but I can only see two.

clash-lib/src/Clash/Core/TermLiteral.hs Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral.hs Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral/TH.hs Outdated Show resolved Hide resolved
@DigitalBrains1
Copy link
Member

I've deleted the outdated comments.

Copy link
Member

@leonschoorl leonschoorl left a comment

Choose a reason for hiding this comment

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

Just like showsPrec has show, I think it makes sense to define a simpler entry function.
So when using it you can do something like:
showTermType (Proxy @a)
Instead of having to do:
termTypePrec 0 (Proxy @a) ""

Following the naming from "Show", it would make sense to then rename termTypePrec to showsTermTypePrec (or showsPrecTermType?).
I wouldn't put show equivalent in the class, like Show does, because I don't think it make sense to redefine it for individual instances. it can just be a standalone function.

changelog/2022-09-14T12_17_00+02_00_add_termTypePrec Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral/TH.hs Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral.hs Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral.hs Outdated Show resolved Hide resolved
@martijnbastiaan
Copy link
Member Author

Done @leonschoorl

Copy link
Member

@DigitalBrains1 DigitalBrains1 left a comment

Choose a reason for hiding this comment

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

I noticed some Haddock thingies.

clash-lib/src/Clash/Core/TermLiteral.hs Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral.hs Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral.hs Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral/TH.hs Outdated Show resolved Hide resolved
Copy link
Member

@DigitalBrains1 DigitalBrains1 left a comment

Choose a reason for hiding this comment

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

There's a convenience function for parentheses that makes the code short and sweet

clash-lib/src/Clash/Core/TermLiteral.hs Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral/TH.hs Outdated Show resolved Hide resolved
clash-lib/src/Clash/Core/TermLiteral/TH.hs Outdated Show resolved Hide resolved
@martijnbastiaan martijnbastiaan merged commit 018df9b into master Sep 15, 2022
@martijnbastiaan martijnbastiaan deleted the termliteral-snat branch September 15, 2022 14:52
martijnbastiaan added a commit that referenced this pull request Sep 16, 2022
vmchale pushed a commit that referenced this pull request Oct 3, 2022
vmchale pushed a commit that referenced this pull request Oct 19, 2022
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.

3 participants