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

Interval.difference/2 removes one interval from another #476

Merged
merged 1 commit into from
Jan 18, 2019

Conversation

nathanl
Copy link
Contributor

@nathanl nathanl commented Oct 12, 2018

Summary of changes

Add Interval.difference/2 to remove one interval from another. This is one of the functions discussed in #460

Checklist

  • New functions have typespecs, changed functions were updated
  • Same for documentation, including moduledocs
  • Tests were added or updated to cover changes
  • Commits were squashed into a single coherent commit

@nathanl nathanl force-pushed the nathanl/add-interval-difference branch from ab7ff3e to c3a9bb5 Compare October 12, 2018 18:24
@coveralls
Copy link

coveralls commented Oct 12, 2018

Coverage Status

Coverage decreased (-0.2%) to 70.629% when pulling a4014db on nathanl:nathanl/add-interval-difference into 933588a on bitwalker:master.

@nathanl nathanl force-pushed the nathanl/add-interval-difference branch from c3a9bb5 to c2417d4 Compare October 12, 2018 18:50
# |--- remove ---|
#
# |- original -|
# |- remove -|
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found these little textual graphs helpful to understand the cases and ensure I'd covered them all. If you don't like keeping them as comments, we can delete them.

Copy link
Owner

Choose a reason for hiding this comment

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

I'm a fan! To keep it simple though, I would make the illustrations part of the @doc with names classifying the operation performed (i.e. empties, no-op, trims start, trims end, and splits), and make the comments in the code refer to that name. This keeps the code compact, but improves the documentation, and gives maintainers a nice visual reference when changes are being proposed/made.

@nathanl nathanl force-pushed the nathanl/add-interval-difference branch from c2417d4 to a4014db Compare November 1, 2018 20:36
@nathanl
Copy link
Contributor Author

nathanl commented Nov 1, 2018

@bitwalker Updated - was this what you had in mind?

@bitwalker bitwalker merged commit 0f7f186 into bitwalker:master Jan 18, 2019
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.

None yet

3 participants