--chameleon -d show.ch interface Prelude --class Show a where -- show :: a->String -- read :: String->a -- we've predefined Show, hence, -- we invent some new names hconstraint MShow extern mshow :: MShow a => a->String extern mread :: MShow a => String->a g :: MShow a => String -> a -> (String,String) g s x = (mshow ((mread s)::a), mshow x) -- Note that we cannot translate this program to Haskell, -- cause Haskell doesn't have lexically scoped type annotations.