Idris2Doc : Text.ByteRange

Text.ByteRange

(source)
Conversion of the bounds of a byte sequence to an text
sequence plus absolute and relative bounds for pretty printing
errors when streaming large files.

Reexports

importpublic Data.ByteString
importpublic Text.ByteBounds

Definitions

recordChunk : Type
  A non-empty chunk of bytes in a sequence or stream of bytes
wrapped up with some counters.

Totality: total
Visibility: public export
Constructor: 
CH : (bytes : ByteString) ->BytePos->Nat->Nat-> {auto0_ : IsSucc (bytes.size)} ->Chunk

Projections:
.bytes : Chunk->ByteString
  The current chunk of bytes
.first : Chunk->BytePos
  Absolute byte position of the first byte in `bytes`
.lines : Chunk->Nat
  Number of line breaks in this chunk
.linesBefore : Chunk->Nat
  Number of line breaks encountered before this chunk
0.prf : ({rec:0} : Chunk) ->IsSucc ((bytes{rec:0}) .size)

Hints:
ShowChunk
ShowChunk
.bytes : Chunk->ByteString
  The current chunk of bytes

Totality: total
Visibility: public export
bytes : Chunk->ByteString
  The current chunk of bytes

Totality: total
Visibility: public export
.first : Chunk->BytePos
  Absolute byte position of the first byte in `bytes`

Totality: total
Visibility: public export
first : Chunk->BytePos
  Absolute byte position of the first byte in `bytes`

Totality: total
Visibility: public export
.linesBefore : Chunk->Nat
  Number of line breaks encountered before this chunk

Totality: total
Visibility: public export
linesBefore : Chunk->Nat
  Number of line breaks encountered before this chunk

Totality: total
Visibility: public export
.lines : Chunk->Nat
  Number of line breaks in this chunk

Totality: total
Visibility: public export
lines : Chunk->Nat
  Number of line breaks in this chunk

Totality: total
Visibility: public export
0.prf : ({rec:0} : Chunk) ->IsSucc ((bytes{rec:0}) .size)
Totality: total
Visibility: public export
0prf : ({rec:0} : Chunk) ->IsSucc ((bytes{rec:0}) .size)
Totality: total
Visibility: public export
.last : Chunk->BytePos
  Absolute position of the last byte in the given `Chunk`.

Totality: total
Visibility: export
.next : Chunk->BytePos
  Absolute position of the first byte of the next chunk after this one.

Totality: total
Visibility: export
.linesIncluding : Chunk->Nat
  Number of linebreaks up to and including the given chunk.

Totality: total
Visibility: export
nextChunk : MaybeChunk-> (bs : ByteString) -> {auto0_ : IsSucc (bs.size)} ->Chunk
  Given an optional previous chunk plus a non-empty byte vector,
computes the stats of the current chunk.

Totality: total
Visibility: export
dataByteRange : Type
  A sequence of chunks, describing if it holds some start
and end position.

Totality: total
Visibility: public export
Constructors:
Prefix : SnocListChunk->ByteRange
Start : SnocListChunk->ByteRange
End : SnocListChunk->ByteRange
Done : SnocListChunk->ByteRange
None : ByteRange

Hints:
ShowByteRange
ShowByteRange
isDone : ByteRange->Bool
Totality: total
Visibility: export
chunks : ByteRange->SnocListChunk
Totality: total
Visibility: export
appendChunk : BytePos->BytePos->ByteRange->ByteString->ByteRange
  Given a start and end position, appends a chunk of bytes to
range of bytes, making sure that the range will contain
enough lines before the start byte and enough lines after the
end byte.

Totality: total
Visibility: export
enclosingBytes : Foldablef=>BytePos->BytePos->fByteString->ByteRange
  Given a sequence (or stream) of byte vectors, we want to find
a minimal chunk fully enclosing a given byte range, so that we
can pretty print that byte range.

The chunk should fulfill the following prerequisites:
* fully contain all bytes given in the byte range
* contain the last five line breaks before the first
byte in the byte range, or - if there are not as many line breaks before
the first byte - contain the first byte of the whole byte stream
so that we can print the whole line where - for instance -
an error occurred
* contain at least the next line-break *after* the last position (if any)

Totality: total
Visibility: export
recordTextBounds : Type
  Absolute and relative text bounds in a stream of byte vectors

Totality: total
Visibility: public export
Constructor: 
TB : String->Bounds->Bounds->TextBounds

Projections:
.absolute : TextBounds->Bounds
  Absolute bounds of the start and end position of the given
byte sequence.
.content : TextBounds->String
  An excerpt of the byte stream large enough to fully contain
a given byte sequence
.relative : TextBounds->Bounds
  Relative bounds of the start and end position of the given
byte sequence.

Hints:
EqTextBounds
EqTextBounds
ShowTextBounds
ShowTextBounds
.content : TextBounds->String
  An excerpt of the byte stream large enough to fully contain
a given byte sequence

Totality: total
Visibility: public export
content : TextBounds->String
  An excerpt of the byte stream large enough to fully contain
a given byte sequence

Totality: total
Visibility: public export
.absolute : TextBounds->Bounds
  Absolute bounds of the start and end position of the given
byte sequence.

Totality: total
Visibility: public export
absolute : TextBounds->Bounds
  Absolute bounds of the start and end position of the given
byte sequence.

Totality: total
Visibility: public export
.relative : TextBounds->Bounds
  Relative bounds of the start and end position of the given
byte sequence.

Totality: total
Visibility: public export
relative : TextBounds->Bounds
  Relative bounds of the start and end position of the given
byte sequence.

Totality: total
Visibility: public export
textBounds : BytePos->BytePos->ByteRange->MaybeTextBounds
  Given a byte range that is supposed to contain the
byte sequence corresponding to the given byte bounds,
returns the proper text bounds - or `Nothing` if
something went wrong.

Totality: total
Visibility: export
toFCErr : ByteErrore->TextBounds->FCErre
Totality: total
Visibility: export