How do I implement statically resolved type parameters?
Specifically, I want to make a function work for all numeric types.
I've tried the following:
let isAbsoluteProductGreaterThanSum a b =
Math.Abs(a * b) > (a + b)
let inline isAbsoluteProductGreaterThanSum a b =
Math.Abs(a * b) > (a + b)
let inline isAbsoluteProductGreaterThanSum ^a ^b =
Math.Abs(^a * ^b) > (^a + ^b)
let inline isAbsoluteProductGreaterThanSum (val1:^a) (val2:^b) =
Math.Abs(val1 * val2) > (val1 + val2)
I did view this documentation but was still unable to resolve my question.