FSharp.Collections.Immutable
FSharp.Collections.Immutable copied to clipboard
Implement `GetSlice`
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