Best way to structure an algebraic data type for ASTs?

You can take a look to the tagless final method which can give you a different way to structure your type.