Skip to content

List.truncate and Array.truncate diverge from Seq.truncate wrt negative inputs #453

Closed

Description

@latkin
[1..5] |> Seq.truncate -1  // empty seq
[1..5] |> List.truncate -1  // throws
[| 1..5 |] |> Array.truncate -1 // throws

Seq.truncate was the original implementation, so IMO the new APIs List.truncate and Array.truncate should match that behavior, i.e. on negative input, return empty collections.

Credit to @imfrancisd for noticing this and pointing it out in #451.

Activity

  1. added this to the VS 2015 milestone on May 17, 2015
  2. added a commit that references this issue on May 17, 2015
    218582b
  3. PatrickMcDonald commented on May 17, 2015

    @PatrickMcDonald
    Contributor

    I've no idea how I invented that new requirement, the mind boggles. Great catch

  4. imfrancisd commented on May 17, 2015

    @imfrancisd

    Thank you! :-)

    I thought I was the only one.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions