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

Reconsider RecurrenceSet::isInfinite method name #134

Closed
dmfs opened this issue Apr 6, 2024 · 0 comments
Closed

Reconsider RecurrenceSet::isInfinite method name #134

dmfs opened this issue Apr 6, 2024 · 0 comments

Comments

@dmfs
Copy link
Owner

dmfs commented Apr 6, 2024

In many cases it's probably easier to deal with when we use the simpler form

boolean isFinite();

The only real use case within lib-recur itself is in LastInstance, which only has a result if the recurrence set is finite.
At present this requires a negation, however, along with dmfs/jems#385 this could be simplified from

new Restrained<>(() -> !recurrenceSet.isInfinite(), new Last<>(recurrenceSet))

to

new If<>(recurrenceSet::isFinite, new Last<>(recurrenceSet))

reducing the cognitive load this needs to be understood.

Initially, to avoid a breaking change, the isFinite method could be added as a default method. In a second step we could swap this to make isInfinite the (deprecated) default method and in a third step we would just drop it entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant