Skip to content

breakEnd, spanEnd #244

Description

@Kile-Asmussen

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

Activity

  1. xtendo-org commented on Aug 5, 2019

    @xtendo-org

    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. :(

  2. epoberezkin commented on May 12, 2025

    @epoberezkin

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

  3. epoberezkin commented on May 12, 2025

    @epoberezkin

    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)

  4. Bodigrim commented on May 12, 2025

    @Bodigrim
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions