Parser gurus,
When you write a parser with a library like Parsec, do you typically
type-check while parsing, or afterward in a separate pass? The latter
is more modular, but it means labeling every element in the AST with
the parser position so that you can give good error messages. Do you
find
I use my type checking monad, which is separate from Parsec's monad.
So, I can't think of a way to type check during parsing in Parsec's monad.
Anyways, this is what I did:
data Expr = ... | At SourcePos Expr
SourcePos is from Parsec.
Basically, my parse actions will return (At pos e).
And I