-
Notifications
You must be signed in to change notification settings - Fork 27
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
leftmost Split #26
Comments
Sure, it could I suppose. Do you have a specific application in mind? And no, I don't think it is the same as
but we wanted |
Yes, I see, I was wrong with the The specific application is splitting strings like I've just written a function that would help for this application:
Still, I don't have a correct implementation of |
But think about the following equations:
This gives us the split we expected, only the sides of I suspect that if we follow this rule in your initial counter-example So, in a sense, the problem would be in ambiguity of the meaning of If we remember that the split that survives is to the right of |
In a sense, there is no necessity to add the "leftmost Split" to your library. It can be shipped separately. But probably the world would be more clear, if it is together with your library. |
It's wrong for my mentioned application, because it throws away the splitting elements from the rest. (Of course!)
But it's a valid thing in its own nevertheless. (Remember the rule |
Yes, I agree it makes sense for it to be defined in this package instead of somewhere else. But without a specific use case I am not particularly motivated to do the work to add it. I would happily accept a pull request if you wanted to write such a module. Or we can just leave this ticket here as an idea for someone in the future. |
So. I have some definition, which I have tried out. But its usefulness is under question -- given the previous comments:
Probably, I'll push it (perhaps, as a pull request) just to have it saved and let you and others decide what to do with it. FYI: As for my motivating goal, I've implemented it differently (and have not thought about its efficiency):
|
Could having a "leftmost" version of Split be handy?
Am I correct that
LeftmostSplit m
would be equivalent toDual (Split (Dual m))
?The text was updated successfully, but these errors were encountered: