I want to write code doing something like C preprocessing. So I looked for libraries and got two candidates, attoparsec
, megaparsec
.
I need the feature reporting error position and megaparsec
already has that. But attoparsec
would be desirable for performance.
If I add the error position feature to attoparsec
's Parser
monad, then should I have to wrap it up in StateT
transformer and lift all that library's function when I use them? I think it's tiresome work. Is there any better method?
EDIT
I will adopt megaparsec
which is appropriate to this situation. But I still want to know how can I wrap attoparsec
's Parser
monad. Is there anyone could tell me whether the method I mentioned above is the best one or not?
I want to know just the monad wrapping method. In other words, whether lifting all inner monad function is the only solution or not.