span package:ghc

Determines whether a span encloses a given line and column index
Divide a map at the point where a predicate on the keys stops holding. The user is responsible for ensuring that for all Ints, j < k ==> p j >= p k.
spanAntitone p xs = (takeWhileAntitone p xs, dropWhileAntitone p xs)
spanAntitone p xs = partitionWithKey (\k _ -> p k) xs
Note: if p is not actually antitone, then spanAntitone will split the map at some unspecified point.
Divide a set at the point where a predicate on the elements stops holding. The user is responsible for ensuring that for all Ints, j < k ==> p j >= p k.
spanAntitone p xs = (takeWhileAntitone p xs, dropWhileAntitone p xs)
spanAntitone p xs = partition p xs
Note: if p is not actually antitone, then spanAntitone will split the set at some unspecified point.
Return the SrcSpan encompassing the contents of any enclosed binds
spanEnd p l == reverse (span p (reverse l)). The first list returns actually comes after the second list (when you look at the input list).
A RealSrcSpan delimits a portion of a text file. It could be represented by a pair of (line,column) coordinates, but in fact we optimise slightly by using more compact representations for single-line and zero-length spans, both of which are quite common. The end position is defined to be the column after the end of the span. That is, a span of (1,1)-(1,2) is one character long, and a span of (1,1)-(1,1) is zero characters long. Real Source Span
Source Span A SrcSpan identifies either a specific portion of a text file or a human-readable description of a location.
Test if a SrcSpan is "good", i.e. has precise location information
Determines whether a span is enclosed by another one
Create a SrcSpan between two points in a file
Built-in "bad" SrcSpans for common sources of location uncertainty
Create a SrcSpan corresponding to a single point
Returns the location at the end of the SrcSpan or a "bad" SrcSpan if that is unavailable