I\'ve been fiddling around with the Elm compiler, which is written in Haskell.
I\'d like to start implementing some optimizations for it, and part of this involves t
This question is very similar to a past one talking about the particular annotation of source location. The solution I find most elegant is to re-define Expr and Def to provide a constructor that contains an annotation:
Expr
Def
data Expr = PlusExpr Expr Expr | AnnotatedExpr Annotation Expr ...