以下で、なぜエラーが出るのかがわからないです。

import Data.Typeable

f :: (Show a, Typeable a) => a -> String
f a = if typeOf a == typeRep (Proxy :: Proxy String) then a else show a

以下のようにすると、なぜかうまくいきます。

f a = if typeOf a == typeRep (Proxy :: Proxy String) then read $ show a else show a