struct MyObject < Object = str :: String myObj = template in struct str = "xyz" ..MyObject main env = do a <- myObj b <- myObj env.putStr (show (a == a) ++ " " ++ show (a == b)) instance Show Object where showsPrec p a = shows a.self -- instance Show MyObject where -- showsPrec p a = showString a.str main' env = do a <- myObj env.putStr (show a)