Hi!

The parser function in my library is exposed to user which hides internally preprocessing & parsing.
When parser error ocurr the coordinates are in preprocessed text, but library function user deserves to know coordinates in original text.

Following is my application flow (simplified):

{- User exposed library function -}
parseLDIF :: String -> Either ParseError LDIF
parseLDIF xs = myParser $ myPreprocessor xs

{- Expects the preprocessed input -}
myParser :: String -> Either ParseError LDIF

{- Remove comments and unwarp lines; No new text added only removed -}
myPreprocessor :: String -> String

My approach I'm going to implement is to keep information what myProcessor did on text (some kind of journal of preprocessing).
In the case of error this journal will be used for original text coordinates calculation.

myPreprocessor :: String -> (String,[PreprocessorOperation])

Anyway, I have feeling that I'm doing something very wrong... reason for this email.
What is the common approach to transform error coordinates from preprocessed to original text ?
Is that common to separate preprocessing & parsing phase ?

Thanks,
Rado