Module Curry.Span

Datatype and operations to handle Spans.

Author
Kai-Oliver Prott
Version
October 2024
data Span

Constructors:

Known instances:


start :: Span -> Position  Deterministic 

Further infos:
  • partially defined

end :: Span -> Position  Deterministic 

Further infos:
  • partially defined

Transformer,


isSpan :: Span -> Bool  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

isNoSpan :: Span -> Bool  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

fromPosition :: Position -> Span  Deterministic 

Create a Span with the given Position as start and end

Further infos:
  • solution complete, i.e., able to compute all solutions

stripStart :: Span -> Span  Deterministic 

Sets the start position of a Span to its end position


span2Pos :: Span -> Position  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

combineSpans :: Span -> Span -> Span  Deterministic 


addSpan :: Span -> (a, [Span]) -> (a, [Span])  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

Distance management


vertDist :: Span -> Span -> Int  Deterministic 

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  Deterministic 

Checks if the first span is completely after the second span.


isBefore :: Span -> Span -> Bool  Deterministic 

Checks if the first span is completely before the second span.


isBeforeList :: Span -> [Span] -> Bool  Deterministic 

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)  Deterministic