Intermediate representation for arithmetic expressions with pretty-printing and lens-based transformations