I have a simple list:
let l = [ 1; 1; 1; 1; 2; 1; 1; 1 ]
I want to know how many elements match the first one, without a break (4 in the example)
let mutable i = 0
while l.[i] = l.[0] do
i <- i + 1
But is there a more F# idiomatic way to do this? through one of the list functions?