The current Array.compareWith implementation in Fable is inconsistent with the F# implementation and documentation.
Here is an example:
let a = [|1;3|]
let b = [|1;2;3|]
// compares lengths first, then elements
let c1 = a < b // equals true
let c2 = compare a b // equals -1
// should compare elements first, then lengths
let c3 = Array.compareWith compare a b // equals 1 in .NET, -1 in Fable
printfn "c1 = %A, c2 = %A, c3 = %A" c1 c2 c3
I'm not sure why FSharp.Core has this inconsistent compare behavior for arrays only (unlike in other collections), but it's there, so this probably needs to be made the same in Fable.
The current
Array.compareWithimplementation in Fable is inconsistent with the F# implementation and documentation.Here is an example:
I'm not sure why
FSharp.Corehas this inconsistent compare behavior for arrays only (unlike in other collections), but it's there, so this probably needs to be made the same in Fable.