How to write a generic F# function to calculate the mean of a collection? I tried:
let inline mean x =
let length = x |> Seq.length
let sum = x |> Seq.sum
LanguagePrimitives.DivideByInt sum length
This seems working fine for float and decimals but surprisingly doesn't work for int with an error saying The type 'int' does not support the operator 'DivideByInt'.