class Key a where
  key :: a -> Int

instance Key Int where
  key = id

instance Key Bool where
  key True = 1
  key False = 0

instance Key String where
  key = read

data KEY = forall a. (Key a) => KEY a

hetList::[KEY]
hetList = [KEY (5::Int), KEY True, KEY "123"]
