Skip to content

breakEnd, spanEnd #244

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

Open
Kile-Asmussen opened this issue Jan 8, 2019 · 4 comments
Open

breakEnd, spanEnd #244

Kile-Asmussen opened this issue Jan 8, 2019 · 4 comments

Comments

@Kile-Asmussen
Copy link

there is a break and span but no breakEnd or spanEnd to mirror them in lieu of takeWhile/takeWhileEnd and dropWhile/dropWhileEnd.

@xtendo-org
Copy link

Where did breakEnd go? I definitely remember seeing breakEnd, so I checked. It was added ten years ago (!) in 3a86c2d. 2009 was when "text" was released, which means the function should be almost as old as the project itself.

So it must have been removed later. Does anyone know what happened? breakEnd/spanEnd is really handy, and it's such a bummer that I have to roll something (probably half-baked and less performant) on my own now. :(

@epoberezkin
Copy link

epoberezkin commented May 12, 2025

spanEnd would be trivial to add, any reason why not? It would avoid double pass.

@epoberezkin
Copy link

epoberezkin commented May 12, 2025

maybe the reason is the possible confusion between which is drop and which is take, because logically it would be reversed compared with span, but documentation would comment on that:

spanEnd p t = (dropWhileEnd p t, takeWhileEnd p t)
span p t = (takeWhile p t, dropWhile p t)

@Bodigrim
Copy link
Contributor

spanEnd would be trivial to add, any reason why not? It would avoid double pass.

Would you like to rebase #312 and fix review suggestions?

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

5 participants