let totalValues (list : int list) = List.sum list

let totalEvenValues(list : int list) =
  list |> List.filter (fun e -> e % 2 = 0) |> List.sum

let totalOddValues(list : int list) =
  list |> List.filter (fun e -> e % 2 <> 0) |> List.sum

printfn "Total of [1..10] is %d" (totalValues [1..10])
printfn "Total of even values in [1..10] is %d" (totalEvenValues [1..10])
printfn "Total of odd values in [1..10] is %d" (totalOddValues [1..10])
//If you want total of numbers greater than 4 you have to write another function :(

//OR

let totalSelectedValues selector (list : int list) = 
  list |> List.filter (fun e -> selector(e)) |> List.sum

printfn "Total of [1..10] is %d" (totalSelectedValues (fun e -> true) [1..10])
printfn "Total of even values in [1..10] is %d" (totalSelectedValues (fun e -> e % 2 = 0) [1..10])
printfn "Total of odd values in [1..10] is %d" (totalSelectedValues (fun e -> e % 2 <> 0) [1..10])
printfn "Total of numbers greater than 4 in [1..10] is %d" (totalSelectedValues (fun e -> e > 4) [1..10])