Skip to content

dropTail, seekTail, splitTail #121

Open
@koraa

Description

@koraa

Functions for accessing the end of a sequence…

const dropTail = (seq, n) => chain(slidingWindow(n+1), map(first));
const seekTail = (seq, n) => chain(slidingWindow(1), last);
example splitTail([a, b, c, d, e], 2) -> [[a, b, c], [d, e]])

Add Try variants too (those are variants that won't complain if the seq is too short)…

This is symmetric with #141; the API should reflect this and both features may need to be added at the same time.

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