Ad
  • Custom User Avatar

    You probably haven't provided usage of the function. So compiler was confused:

    let sumTwoSmallestNumbers = 
        Seq.sort 
        >> Seq.take 2 
        >> Seq.sum // The type 'System.IComparable' does not support the operator 'get_Zero' 
    

    But if you add something like code below, then type will be inferred as int64.

    sumTwoSmallestNumbers [|5L; 8L; 12L; 19L; 22L|] 
    |> printfn "%A"
    

    Error message gives you a hint though: "Consider adding further type constraints"