A tagged struct would be more idiomatic.