loc-0.2.0.0: Line and column positions and ranges in text files
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Loc.SpanOrLoc

Synopsis

Documentation

data SpanOrLoc Source #

A SpanOrLoc consists of a start location and an end location

The end location must be greater than or equal to the start location; in other words, backwards spans are not permitted.

If the start and end location are the same, then the value is a SpanOrLoc. If they differ, then the value is a SpanOrLoc.

Instances

Instances details
Show SpanOrLoc Source # 
Instance details

Defined in Data.Loc.SpanOrLoc

Eq SpanOrLoc Source # 
Instance details

Defined in Data.Loc.SpanOrLoc

Ord SpanOrLoc Source # 
Instance details

Defined in Data.Loc.SpanOrLoc

Constructing

fromTo :: Loc -> Loc -> SpanOrLoc Source #

Construct a SpanOrLoc from two SpanOrLocs

If the two locs are not equal, the lesser loc will be the start, and the greater loc will be the end.

Deconstructing

spanOrLoc :: (Span -> a) -> (Loc -> a) -> SpanOrLoc -> a Source #

Querying