Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Area
- fromTo :: Loc -> Loc -> Area
- spanArea :: Span -> Area
- (+) :: Area -> Area -> Area
- (-) :: Area -> Area -> Area
- addSpan :: Span -> Area -> Area
- firstSpan :: Area -> Maybe Span
- lastSpan :: Area -> Maybe Span
- start :: Area -> Maybe Loc
- end :: Area -> Maybe Loc
- areaSpan :: Area -> Maybe Span
- spansAsc :: Area -> [Span]
- spanCount :: Area -> Natural
- areaShowsPrec :: Int -> Area -> ShowS
- areaReadPrec :: ReadPrec Area
Documentation
Constructing
Combining
(+) :: Area -> Area -> Area Source #
The union of two Area
s. Spans that overlap or abut will be merged in the
result.
>>>
read "[1:1-1:2]" + mempty
[1:1-1:2]
>>>
read "[1:1-1:2]" + read "[1:2-1:3]"
[1:1-1:3]
>>>
read "[1:1-1:2]" + read "[1:1-3:1]"
[1:1-3:1]
>>>
read "[1:1-1:2]" + read "[1:1-11:1]"
[1:1-11:1]
>>>
read "[1:1-3:1,6:1-6:2]" + read "[1:1-6:1]"
[1:1-6:2]
>>>
read "[1:1-3:1]" + read "[5:1-6:2]"
[1:1-3:1,5:1-6:2]
Querying
spanCount :: Area -> Natural Source #
>>>
spanCount mempty
0
>>>
spanCount (read "[3:4-7:2]")
1
>>>
spanCount (read "[3:4-7:2,15:6-17:9]")
2
Show and Read
areaReadPrec :: ReadPrec Area Source #
>>>
readPrec_to_S areaReadPrec minPrec "[]"
[([],"")]
>>>
readPrec_to_S areaReadPrec minPrec "[3:2-5:5,8:3-11:4]"
[([3:2-5:5,8:3-11:4],"")]
>>>
readPrec_to_S areaReadPrec minPrec "[3:2-5:5,11:4-8:3]"
[([3:2-5:5,8:3-11:4],"")]
>>>
readPrec_to_S areaReadPrec minPrec "[3:2-5:5,8:3-8:3]"
[]