I think it suffices to define `print` and you get both of these automatically.