SourcePos package:megaparsec

The data type SourcePos represents source positions. It contains the name of the source file, a line number, and a column number. Source line and column positions change intensively during parsing, so we need to make them strict to avoid memory leaks.
Pretty-print a SourcePos.
Return the current source position. This function is not cheap, do not call it e.g. on matching of every token, that's a bad idea. Still you can use it to get SourcePos to attach to things that you parse. The function works under the assumption that we move in the input stream only forwards and never backwards, which is always true unless the user abuses the library.
Source position corresponding to beginning of pstateInput
Attach SourcePoses to items in a Traversable container given that there is a projection allowing us to get an offset per item. Items must be in ascending order with respect to their offsets.