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

Tweak compareLength rules #314

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Conversation

vdukhovni
Copy link
Contributor

  • Consolidate RULES pragmas
  • Replace negateOrdering with compare EQ.

Copy link
Contributor

@Bodigrim Bodigrim left a comment

Choose a reason for hiding this comment

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

Thanks!

@Bodigrim Bodigrim requested a review from sjakobi October 25, 2020 22:26
#-}

{-# RULES
compare n (length t) = compare EQ $ compareLength t n
Copy link
Member

Choose a reason for hiding this comment

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

This is not a readability improvement IMHO, but I don't care too much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A comment could be added that compare EQ LT = GT and vice versa. Would that be helpful? I just didn't see a need to define a new function for this...

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that comment would be helpful. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

- Consolidate RULES pragmas
- Replace `negateOrdering` with `compare EQ`.
@Bodigrim Bodigrim merged commit d7c9647 into haskell:master Oct 28, 2020
@vdukhovni vdukhovni deleted the ordering-rules branch October 28, 2020 18:17
@Bodigrim Bodigrim added this to the 0.11.1.0 milestone Oct 28, 2020
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.

4 participants