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

Add conversion functions to structural desc of disjoint matches #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ohad
Copy link
Collaborator

@ohad ohad commented Mar 18, 2023

No description provided.

Comment on lines +51 to +53
disjointMatches : (re : TyRE a) -> {auto 0 consuming : IsConsuming re}
-> List Char -> (greedy : Bool)
-> (List (List Char, a), List Char)
Copy link
Owner

Choose a reason for hiding this comment

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

The API for our lib is in Data.Regex, so if you want to have this outside of this lib it should most probably be there. I think it's reasonable to drop the current asDisjointMatches from there.

Copy link
Collaborator Author

@ohad ohad Mar 23, 2023

Choose a reason for hiding this comment

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

I started by thinking it should be dropped, but then I thought it does express the inductive pattern better, so maybe it's useful to export it. What do you think?

Copy link
Owner

Choose a reason for hiding this comment

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

Well, I see a benefit in using common data structures instead of ones defined in TyRE. It feels potentially more flexible and easier to understand for the end user. On the other hand, the type looks a bit less pleasant. Otherwise, I don't see much of a difference. I'd decide only for one of those to be exported, but I'm not sure which one it should be.

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.

2 participants