I've specified a custom type which takes two floats and makes them a pair (a complex number):
type complex = (float * float);;
let makeComplex x y = complex(x,y);;
The makeComplex
function is of type float -> float -> complex
, which is entirely correct. However, I want to create a function that takes a complex type and makes it a normal pair as well.
This is the function I've tried:
let complexToPair ((x,y):complex) = (x,y);;
But the resulting type is float * float -> float * float
, when it should really be complex -> float * float
. Am I using the wrong syntax for the ((x,y):complex)
part?