Datatype and operations to handle Spans.
data Span
Constructors:
Known instances:
fromPosition
:: Position -> Span
Create a Span with the given Position as start and end
stripStart
:: Span -> Span
Sets the start position of a Span to its end position
combineSpans
:: Span -> Span -> Span
addSpan
:: Span -> (a, [Span]) -> (a, [Span])
vertDist
:: Span -> Span -> Int
Computes a "vertical distance" between two spans. It is either the row distance of the start end end positions or zero, if the spans overlap.
isAfter
:: Span -> Span -> Bool
Checks if the first span is completely after the second span.
isBefore
:: Span -> Span -> Bool
Checks if the first span is completely before the second span.
isBeforeList
:: Span -> [Span] -> Bool
Checks if the first span is completely
before the first span of a list.
Reurns True
if the list is empty
spanLength
:: Span -> (Int, Int)