I started learning F# and am confused about the type issues. for context i am searching for the maximum volume of a cylinder given a list of tuples containing radius, height
i am getting a "This expression was expected to have type 'float' but here has type 'float*float' when i call recMax hd t1
let CylinderVolume ((radius, height) : float*float) =
height * System.Math.PI * radius * radius
let maxCylinderVolume list : float =
match list with
| [] -> 0.0
| hd :: t1 ->
let rec recMax maxSoFar items =
match items with
| [] -> maxSoFar
| hd :: t1 ->
if (CylinderVolume hd) > maxSoFar then
recMax (hd) t1
else
recMax maxSoFar t1
recMax hd t1
recMax (CylinderVolume hd) t1instead? - Asti