Closed omaus closed 2 years ago
Seq.groupWhen returns incorrect results under specific circumstances (s. below).
Seq.groupWhen
#r "nuget: FSharpAux" open FSharpAux
let testArr = [| 3 3 2 4 1 2 1 |]
let isOdd n = n % 2 <> 0
Seq.groupWhen isOdd testArr
2. Execute ### Expected behavior ```f# val it : seq<seq<int>> = seq [[3]; [3; 2; 4]; [1; 2]; [1]]
val it : seq<seq<int>> = seq [[3]; [3; 2; 4]; [1; 2; 1]]
Last item is not grouped alone even if it should be.
n/a
Description
Seq.groupWhen
returns incorrect results under specific circumstances (s. below).Repro steps
let testArr = [| 3 3 2 4 1 2 1 |]
let isOdd n = n % 2 <> 0
Seq.groupWhen isOdd testArr
Actual behavior
Last item is not grouped alone even if it should be.
Known workarounds
n/a
Related information