Consider the following definition fun f(a, b, c) = a + (if b > c then b else c) + 1 using Hindley-Milner type inference, determine the type of f. Note that the if expression evaluates to a value (either b or c) which gets added to a and 1. Solution We will split language into elements... a ---> identifier + ---> operator if ---> condition b ---> identifier > ---> relational operator c ---> identifier then b else c ---> compute condition primitive application 1 ---> Integer So from above all steps our conclusion is.. a may be either integer or double.. so by looking into identifer a, we cannot judge. From second expression, if condition the result may be \"b\" or \"c\". We don\'t know exact \"b\" and \"c\" variables. So we cannot judge. But finally we are adding 1 to result which results integer result. Since we cannot add integer to String. So type of f is int. .