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

support singleton String ops for refined Inference #134

Closed
erikerlandson opened this issue Apr 9, 2020 · 1 comment
Closed

support singleton String ops for refined Inference #134

erikerlandson opened this issue Apr 9, 2020 · 1 comment

Comments

@erikerlandson
Copy link
Contributor

singleton-ops is in a position to allow the refined Inference implicit rules to go "macro-less" and discard the isValid field (see fthomas/refined#755). Most of the places where these rules currently punt to isValid are numeric, and already addressable via singleton-ops, but StringInference rules require some singleton operations that do not exist (IIUC):

  • BeginsWith[S1, S2]
  • EndsWith[S1, S2]

There might be others that could be useful, like a hypothetical MatchesPattern[S, P], where P is a singleton string representing a regex.

@soronpo
Copy link
Collaborator

soronpo commented Apr 10, 2020

Looks like a good idea to implement MatchesPattern[S, P] and use a composition of it to create BeginsWith and the rest.

erikerlandson added a commit to erikerlandson/singleton-ops that referenced this issue Apr 10, 2020
erikerlandson added a commit to erikerlandson/singleton-ops that referenced this issue Apr 11, 2020
soronpo pushed a commit that referenced this issue Apr 11, 2020
Fix #134 - add some string and regex ops
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

2 participants