Hello,

Could anyone help me understand what is wrong with the definition of f2 in the code below?


class C a b where   
    convert :: a -> b

convertToInt :: (C a Int) => a -> Int
convertToInt x = convert x
 
f1 x =  convertToInt x

f2 = \x -> convertToInt x

f3 :: (C a Int) => a -> Int
f3 = \x -> convertToInt x

Thank you

Regards

J-C