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

Reimplement existing validators as fluent, core feature #200

Open
fushar opened this issue Oct 27, 2024 · 0 comments
Open

Reimplement existing validators as fluent, core feature #200

fushar opened this issue Oct 27, 2024 · 0 comments
Assignees

Comments

@fushar
Copy link
Member

fushar commented Oct 27, 2024

We have started writing some number and vector validators as individual functions.

We want to convert the existing validators to become "fluent", so that:

  • It can benefit from compiler autocomplete feature
  • To prepare for future graph/tree validators

We also want to make them as "core" feature, i.e. users don't have to include any other headers.

List of changes:

Before After
isBetween(n, a, b) valueOf(n).isBetween(a, b)
eachElementIsBetween(v, a, b) eachElementOf(v).isBetween(a, b)
elementsAreAscending(v) elementsOf(v).areAscending()
elementsAreDescending(v) elementsOf(v).areDescending()
elementsAreNonAscending(v) elementsOf(v).areNonAscending()
elementsAreNonDescending(v) elementsOf(v).areNonDescending()
elementsAreUnique(v) elementsOf(v).areUnique()
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

No branches or pull requests

1 participant