Skip to content

Implement GetSlice #16

@xperiandri

Description

@xperiandri

Like

[<Extension>]
type SliceExtensions =

    [<Extension>]
    static member GetSlice(source: FlatList<'t>, from: int option, ``to``: int option) =
        let from = from |> Option.defaultValue 0
        let ``to`` = ``to`` |> Option.defaultValue source.Length
        source
        |> Seq.skip from
        |> Seq.take (``to`` - from + 1)
        |> Seq.toFlatList

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions