Text this: A theory of variable types