Skip to content

semantics of slice, now and future (plus near term bug fixes) #276

@cartazio

Description

@cartazio

cc @Shimuuar @lehins

My interpretation of slice, which may not be the universal one, but I believe reflects a common intent, is when I write

import Data.Vector as V
...
V.slice startIx runlength vec

i'm always like "what?! I wanted to write an inclusive coordinate interval"

V.slice startIx endIx vec

if the user's semantics is "i want/need this interval", throwing an error and promptly aborting is the only option i can see for the current type signature when that interval doesn't exist.

I'd even go further, and suspect that currently

  1. slice with the base index and runlength api we currently have is arecurrent gotcha

  2. any semantics that doesn't relate to the coordinate interval one might be problematical (though, there are some cut semantical tricks if we think about the coordinates in a modulus sorta sense, a la -1 et al in python sequences, but thats not the current topic)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions