Skip to content

Add carry/borrow to Fallible<MutableDataInt.Body> #148

Open

Description

@oscbyspro

The MutableDataInt<Element>.Body model has many operation pairs similar to this:

extension MutableDataInt.Body {
    consuming func increment(..............) -> Fallible<Self>
    consuming func incrementSubSequence(...) -> Fallible<Self>
}

The *SubSequence operations represent some core algorithm that stops at the end of the given arguments. The non-*SubSequence carries or borrows the error indicator after that point. What if I instead add a carry() and borrow() to Fallible<MutableDataInt.Body>? I believe those two methods would make every non-*SubSequence variant obsolete.

Activity

  1. oscbyspro commented on Dec 14, 2024

    @oscbyspro
    OwnerAuthor

    Alternatively, I could have special return types that continue() by carrying or borrowing. Is that too complex? I'll have to think about it some more before I commit to any particular solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    additionoh, so shiny!brrrsuch code, much wowmaybeto do, or not to do?subtractionhuh? where did it go?

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions