jack-pappas / ExtCore

An extended core library for F#.
Apache License 2.0
178 stars 32 forks source link

Deprecate substring in favor of ReadOnlySpan<char>? #45

Open jack-pappas opened 5 years ago

jack-pappas commented 5 years ago

For ExtCore 1.0, consider replacing the substring type in favor of the new ReadOnlySpan<char> type. substring is useful for avoiding allocations in text-processing code, but unfortunately there are some inconsistencies in it's implementation (and functions in the Substring module) w.r.t. whether indices used in functions represent an index into the original string or within the substring. Moving to ReadOnlySpan<char> gives us a chance to fix this, and also provides an API that'll be more compatible with the rest of F# and the broader .NET ecosystem.

vasily-kirichenko commented 5 years ago

(however, tbh, I was not even aware there is substring type, so I don't have an opinion on removing it)