fsharp
fsharp copied to clipboard
Unify exceptions for out of bounds conditions in core functions
We have 3 different behaviors currently:
X.skip throws InvalidArgOutOfRange when count > n
X.take throws InvalidOperation when count > n
X.sample throws InvalidArg when count > n
We should unify this, updating the code along with RFCs probably.
Originally posted by @Lanayx in https://github.com/dotnet/fsharp/pull/17277#discussion_r1653866870
All those will be breaking changes, fwiw.
Yeah that's clear, don't expect this to be easy-breezy :shrug:
Agree, should be InvalidArgOutOfRange for all 3 APIs.
Refer to the .NET SDK breaking change guidelines