型によって処理を分岐させたいんだがうまくいかん。

import Data.HashTable
import Data.Typeable

hoge a = if typeOf a == typeOf "A"
then do hash <- new (==) hashString
hoge2 hash a
else do hash <- new (==) hashInt
hoge2 hash a
hoge2 hash' b = update hash' b "HOGE"

これだと、次のようなエラーが出る。

test.hs:8:28:
Couldn't match expected type `Int' against inferred type `String'
Expected type: Int
Inferred type: String
In the second argument of `hoge2', namely `a'
In the expression: hoge2 hash a

関数の中では、型変数の型は一つしかとれないということなのかな・・・?
こういう場合はどうしたらいいんだろう。