Skip to content

tailOption and initOption #165

Open
Open
@julian-a-avar-c

Description

@julian-a-avar-c

For symmetry. Once in a while I need them because the sequence might be empty.

Seq().tail and Seq().init throw errors. Ideally I want those two to be corrected and return an empty sequence, but I understand that might break backwards compatibility.

One other alternative to these is seq.drop(1) and seq.dropRight(1), as they safely work as expected. However, I think adding tailOption and initOption would bring the value of not having to remember they don't exist when I want to have the functionality of, "take the tail, but the sequence was empty".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions