Idris2Doc : Data.ByteVect

Data.ByteVect

(source)

Reexports

importpublic Data.Buffer.Core
importpublic Data.Buffer.Indexed
importpublic Data.Byte

Definitions

dataByteVect : Nat->Type
  An immutable, length-indexed byte vector.

Internally represented by a `Data.Buffer` together
with its length and offset.

The internal buffer is treated as being immutable,
so operations modifying a `ByteVect` will create
and write to a new `Buffer`.

Totality: total
Visibility: public export
Constructor: 
BV : IBufferbufLen-> (offset : Nat) -> (0_ : LTE (offset+len) bufLen) ->ByteVectlen

Hints:
Cast (ByteVectn) ByteString
Cast (ByteVectn) ByteString
Interpolation (ByteVectn)
Show (ByteVectn)
fromIBuffer : IBuffern->ByteVectn
  Wrappes an immutable buffer in a `ByteVect`

Totality: total
Visibility: export
recordByteString : Type
  An immutable string of raw bytes. For an length-indexed version,
see module `ByteVect` and `Data.ByteVect`.

Totality: total
Visibility: public export
Constructor: 
BS : (size : Nat) ->ByteVectsize->ByteString

Projections:
.repr : ({rec:0} : ByteString) ->ByteVect (size{rec:0})
.size : ByteString->Nat

Hints:
CastStringByteString
Cast (ListBits8) ByteString
CastBits8ByteString
CastCharByteString
Cast (ByteVectn) ByteString
Cast (IBuffern) ByteString
CastAnyBufferByteString
CastAnyBufferByteString
Cast (IBuffern) ByteString
Cast (ByteVectn) ByteString
CastCharByteString
CastBits8ByteString
Cast (ListBits8) ByteString
CastStringByteString
EqByteString
EqByteString
FromStringByteString
FromStringByteString
InterpolationByteString
InterpolationByteString
MonoidByteString
MonoidByteString
OrdByteString
OrdByteString
SemigroupByteString
SemigroupByteString
ShowByteString
ShowByteString
.size : ByteString->Nat
Totality: total
Visibility: public export
size : ByteString->Nat
Totality: total
Visibility: public export
.repr : ({rec:0} : ByteString) ->ByteVect (size{rec:0})
Totality: total
Visibility: public export
repr : ({rec:0} : ByteString) ->ByteVect (size{rec:0})
Totality: total
Visibility: public export
freezeByteString : WithMBuffernByteString
  Safely wrap a mutable buffer in a `ByteString`.

Totality: total
Visibility: export
unsafeFreezeByteString : WithMBuffernByteString
  Wrap a mutable buffer in a `ByteString` without copying.

Use this for reasons of efficiency when you are sure the buffer
will not be shared otherwise.

Totality: total
Visibility: export
freezeByteStringLTE : (m : Nat) -> {auto0_ : LTEmn} ->WithMBuffernByteString
  Safely wrap a mutable buffer in a `ByteString`.

Totality: total
Visibility: export
unsafeFreezeByteStringLTE : (m : Nat) -> {auto0_ : LTEmn} ->WithMBuffernByteString
  Wrap a mutable buffer in a `ByteString` without copying.

Use this for reasons of efficiency when you are sure the buffer
will not be shared otherwise.

Totality: total
Visibility: export
at : ByteVectn->Finn->Bits8
  Reads the value of a `ByteVect` at the given position

Totality: total
Visibility: export
ix : ByteVectn-> (0m : Nat) ->Ix (Sm) n=>Bits8
  Safely access a value in an array at position `n - m`.

Totality: total
Visibility: export
atNat : ByteVectn-> (m : Nat) -> {auto0_ : LTmn} ->Bits8
  Safely access a value in an array at the given position.

Totality: total
Visibility: export
fromEnd : ByteVectn-> (m : Nat) -> {auto0_ : LTmn} ->Bits8
Totality: total
Visibility: export
empty : ByteVect0
  The empty `ByteVect`.

Totality: total
Visibility: export
pack : (as : ListBits8) ->ByteVect (lengthas)
  Converts a list of values to a `ByteVect` using
the given conversion function. O(n).

Totality: total
Visibility: export
fromString : (s : String) ->ByteVect (cast (stringByteLengths))
  Converts a `String` to a `ByteVect`. Note: This will
correctly decode the corresponding UTF-8 string.

Totality: total
Visibility: export
toString : ByteVectn->String
  Converts a `ByteVect` to a UTF-8 encoded string

Totality: total
Visibility: export
singleton : Bits8->ByteVect1
  Creates a `ByteVect` holding a single `Bits8` value.

Totality: total
Visibility: export
toList : (Bits8->a) ->ByteVectn->Lista
  Convert a `ByteVect` to a list of values using
the given conversion function.

Totality: total
Visibility: export
unpack : ByteVectn->ListBits8
  Converts a `ByteVect` to a list of `Bits8` values. O(n).

Totality: total
Visibility: export
hcomp : ByteVectm->ByteVectn->Ordering
  Lexicographic comparison of `ByteVect`s of distinct length

Totality: total
Visibility: export
heq : ByteVectm->ByteVectn->Bool
  Heterogeneous equality for `ByteVect`s

Totality: total
Visibility: export
generate : (n : Nat) -> (Finn->Bits8) ->ByteVectn
Totality: total
Visibility: export
replicate : (n : Nat) ->Bits8->ByteVectn
Totality: total
Visibility: export
append : ByteVectm->ByteVectn->ByteVect (m+n)
  Concatenate two `ByteVect`s. O(n + m).

Totality: total
Visibility: export
cons : Bits8->ByteVectn->ByteVect (Sn)
  Prepend a single `Bits8` to a `ByteVect`. O(n).

Totality: total
Visibility: export
snoc : Bits8->ByteVectn->ByteVect (n+1)
  Append a single `Bits8` to a `ByteVect`. O(n).

Totality: total
Visibility: export
head : ByteVect (Sn) ->Bits8
  Read the first element of a `ByteVect`. O(1).

Totality: total
Visibility: export
tail : ByteVect (Sn) ->ByteVectn
  Drop the first `Bits8` from a `ByteVect`. O(1).

Totality: total
Visibility: export
uncons : ByteVect (Sn) -> (Bits8, ByteVectn)
  Split the first `Bits8` from a `ByteVect`. O(1).

Totality: total
Visibility: export
last : ByteVect (Sn) ->Bits8
  Read the last `Bits8` from a `ByteVect`. O(1).

Totality: total
Visibility: export
init : ByteVect (Sn) ->ByteVectn
  Drop the last `Bits8` from a `ByteVect`. O(1).

Totality: total
Visibility: export
unsnoc : ByteVect (Sn) -> (Bits8, ByteVectn)
  Split a `ByteVect` at the last byte. O(1).

Totality: total
Visibility: export
map : (Bits8->Bits8) ->ByteVectn->ByteVectn
  Converts every `Bits8` in a `ByteVect` by applying the given
function. O(n).

Totality: total
Visibility: export
toUpper : ByteVectn->ByteVectn
  Interpreting the values stored in a `ByteVect` as 8 bit characters,
convert every lower-case character to its upper-case form. O(n)

Totality: total
Visibility: export
toLower : ByteVectn->ByteVectn
  Interpreting the values stored in a `ByteVect` as 8 bit characters,
convert every upper-case character to its lower-case form. O(n)

Totality: total
Visibility: export
reverse : ByteVectn->ByteVectn
  Inverse the order of bytes in a `ByteVect`. O(n)

Totality: total
Visibility: export
all : (Bits8->Bool) ->ByteVectn->Bool
  True, if the predicate holds for all bytes
in the given `ByteVect`. O(n)

Totality: total
Visibility: export
any : (Bits8->Bool) ->ByteVectn->Bool
  True, if the predicate holds for at least one byte
in the given `ByteVect`. O(n)

Totality: total
Visibility: export
elem : Bits8->ByteVectn->Bool
  True, if the given `Bits8` appears in the `ByteVect`. O(n)

Totality: total
Visibility: export
foldl : (a->Bits8->a) ->a->ByteVectn->a
  Fold a `ByteVect` from the left. O(n)

Totality: total
Visibility: export
foldr : (Bits8->a->a) ->a->ByteVectn->a
  Fold a `ByteVect` from the right. O(n)

Totality: total
Visibility: export
findIndex : (Bits8->Bool) ->ByteVectn->Maybe (Finn)
  The `findIndex` function takes a predicate and a `ByteVect` and
returns the index of the first element in the ByteVect
satisfying the predicate. O(n)

Totality: total
Visibility: export
elemIndex : Bits8->ByteVectn->Maybe (Finn)
  Return the index of the first occurence of the given
byte in the `ByteVect`, or `Nothing`, if the byte
does not appear in the ByteVect. O(n)

Totality: total
Visibility: export
find : (Bits8->Bool) ->ByteVectn->MaybeBits8
  Returns the first value byte in a `ByteVect` fulfilling
the given predicate. O(n)

Totality: total
Visibility: export
isPrefixOf : ByteVectm->ByteVectn->Bool
Totality: total
Visibility: export
isSuffixOf : ByteVectm->ByteVectn->Bool
Totality: total
Visibility: export
substring : (start : Nat) -> (length : Nat) ->ByteVectn-> {auto0_ : LTE (start+length) n} ->ByteVectlength
  Like `substr` for `String`, this extracts a substring
of the given `ByteVect` at the given start position
and of the given length. O(1).

Totality: total
Visibility: export
substringFromTill : (from : Nat) -> (till : Nat) -> {auto0_ : LTEfromtill} -> {auto0_ : LTEtilln} ->ByteVectn->ByteVect (minustillfrom)
  Like `substring` but extracts a substring from position
`from` up to but not including position `till`.

Totality: total
Visibility: export
substringFromTo : (from : Nat) -> (to : Nat) -> {auto0_ : LTEfromto} -> {auto0_ : LTton} ->ByteVectn->ByteVect (minus (Sto) from)
  Like `substring` but extracts a substring from position
`from` up to and including position `to`.

Totality: total
Visibility: export
generateMaybe : (n : Nat) -> (Finn->MaybeBits8) ->ByteString
Totality: total
Visibility: export
mapMaybe : (Bits8->MaybeBits8) ->ByteVectn->ByteString
Totality: total
Visibility: export
filter : (Bits8->Bool) ->ByteVectn->ByteString
Totality: total
Visibility: export
take : (0k : Nat) -> {auto0_ : LTEkn} ->ByteVectn->ByteVectk
  Return a `ByteVect` with the first `n` values of
the input string. O(1)

Totality: total
Visibility: export
takeEnd : (k : Nat) -> {auto0_ : LTEkn} ->ByteVectn->ByteVectk
  Return a `ByteVect` with the last `n` values of
the input string. O(1)

Totality: total
Visibility: export
drop : (k : Nat) -> {auto0_ : LTEkn} ->ByteVectn->ByteVect (minusnk)
  Remove the first `n` values from a `ByteVect`. O(1)

Totality: total
Visibility: export
dropEnd : (0k : Nat) -> {auto0_ : LTEkn} ->ByteVectn->ByteVect (minusnk)
  Remove the last `n` values from a `ByteVect`. O(1)

Totality: total
Visibility: export
splitAt : (k : Nat) -> {auto0_ : LTEkn} ->ByteVectn-> (ByteVectk, ByteVect (minusnk))
Totality: total
Visibility: export
takeWhile : (Bits8->Bool) ->ByteVectn->ByteString
  Extracts the longest prefix of elements satisfying the
predicate.

Totality: total
Visibility: export
takeWhileEnd : (Bits8->Bool) ->ByteVectn->ByteString
  Returns the longest (possibly empty) suffix of elements
satisfying the predicate.

Totality: total
Visibility: export
dropWhile : (Bits8->Bool) ->ByteVectn->ByteString
  Drops the longest (possibly empty) prefix of elements
satisfying the predicate and returns the remainder.

Totality: total
Visibility: export
dropWhileEnd : (Bits8->Bool) ->ByteVectn->ByteString
  Drops the longest (possibly empty) suffix of elements
satisfying the predicate and returns the remainder.

Totality: total
Visibility: export
trimLeft : ByteVectn->ByteString
  Remove leading whitespace from a `ByteString`

Totality: total
Visibility: export
trimRight : ByteVectn->ByteString
  Remove trailing whitespace from a `ByteString`

Totality: total
Visibility: export
trim : ByteVectn->ByteString
  Remove all leading and trailing whitespace from a `ByteString`

Totality: total
Visibility: export
recordBreakRes : Nat->Type
Totality: total
Visibility: public export
Constructor: 
MkBreakRes : (lenFst : Nat) -> (lenSnd : Nat) ->ByteVectlenFst->ByteVectlenSnd-> (0_ : LTE (lenFst+lenSnd) n) ->BreakResn

Projections:
.fst : ({rec:0} : BreakResn) ->ByteVect (lenFst{rec:0})
.lenFst : BreakResn->Nat
.lenSnd : BreakResn->Nat
0.prf : ({rec:0} : BreakResn) ->LTE (lenFst{rec:0}+lenSnd{rec:0}) n
.snd : ({rec:0} : BreakResn) ->ByteVect (lenSnd{rec:0})
.lenFst : BreakResn->Nat
Totality: total
Visibility: public export
lenFst : BreakResn->Nat
Totality: total
Visibility: public export
.lenSnd : BreakResn->Nat
Totality: total
Visibility: public export
lenSnd : BreakResn->Nat
Totality: total
Visibility: public export
.fst : ({rec:0} : BreakResn) ->ByteVect (lenFst{rec:0})
Totality: total
Visibility: public export
fst : ({rec:0} : BreakResn) ->ByteVect (lenFst{rec:0})
Totality: total
Visibility: public export
.snd : ({rec:0} : BreakResn) ->ByteVect (lenSnd{rec:0})
Totality: total
Visibility: public export
snd : ({rec:0} : BreakResn) ->ByteVect (lenSnd{rec:0})
Totality: total
Visibility: public export
0.prf : ({rec:0} : BreakResn) ->LTE (lenFst{rec:0}+lenSnd{rec:0}) n
Totality: total
Visibility: public export
0prf : ({rec:0} : BreakResn) ->LTE (lenFst{rec:0}+lenSnd{rec:0}) n
Totality: total
Visibility: public export
breakRes : ByteVectn->SubLengthn->BreakResn
Totality: total
Visibility: export
break : (Bits8->Bool) ->ByteVectn->BreakResn
  Returns the longest (possibly empty) prefix of elements which do not
satisfy the predicate and the remainder of the string.

Totality: total
Visibility: export
breakNL : ByteVectn->BreakResn
  Returns the longest (possibly empty) prefix before the first newline character

Totality: total
Visibility: export
breakEnd : (Bits8->Bool) ->ByteVectn->BreakResn
  Returns the longest (possibly empty) suffix of elements which do not
satisfy the predicate and the remainder of the string.

Totality: total
Visibility: export
span : (Bits8->Bool) ->ByteVectn->BreakResn
  Returns the longest (possibly empty) prefix of elements
satisfying the predicate and the remainder of the string.

Totality: total
Visibility: export
spanEnd : (Bits8->Bool) ->ByteVectn->BreakResn
  Returns the longest (possibly empty) suffix of elements
satisfying the predicate and the remainder of the string.

Totality: total
Visibility: export
substringIndex : ByteVectk->ByteVectn->SubLengthn
  Returns the index where the given substring occurs in the
given bytevector for the first time

Totality: total
Visibility: export
breakAtSubstring : ByteVectk->ByteVectn->BreakResn
  Returns the longest (possibly empty) prefix of a
byte vector that does not contain the given substring
plus the remainder of the byte vector.

Totality: total
Visibility: export
splitWith : (Bits8->Bool) ->ByteVectn->ListByteString
  Splits a 'ByteVect' into components delimited by
separators, where the predicate returns True for a separator element.
The resulting components do not contain the separators. Two adjacent
separators result in an empty component in the output. eg.

Totality: total
Visibility: export
splitWithNonEmpty : (Bits8->Bool) ->ByteVectn->ListByteString
  Like `splitWith`, but removes empty components.

Totality: total
Visibility: export
split : Bits8->ByteVectn->ListByteString
  Break a `ByteVect` into pieces separated by the byte
argument, consuming the delimiter.

As for all splitting functions in this library, this function does
not copy the substrings, it just constructs new `ByteString`s that
are slices of the original.

Totality: total
Visibility: export
splitNonEmpty : Bits8->ByteVectn->ListByteString
  Like `split`, but removes empty components.

Totality: total
Visibility: export
lines : ByteVectn->ListByteString
Totality: total
Visibility: export
splitAtSubstring : ByteVectk->ByteVectn->ListByteString
  Splits the second byte vector whenever the first called
`sep` occurs.

The bytestrings in the result no longer contain `sep` as
a substring.

Note: If `sep` is the empty byte vector, `[BS n val]` is returned
as the result.

Totality: total
Visibility: export
isInfixOf : ByteVectm->ByteVectn->Bool
Totality: total
Visibility: export
parseAnyNat : (base : Nat) -> {auto0_ : LTE2base} -> {auto0_ : LTEbase16} ->ByteVectn->MaybeNat
  Parse a natural number in the given base.

Totality: total
Visibility: export
parseDecimalNat : ByteVectn->MaybeNat
  Parses a natural number in decimal notation.

Totality: total
Visibility: export
parseHexadecimalNat : ByteVectn->MaybeNat
Totality: total
Visibility: export
parseOctalNat : ByteVectn->MaybeNat
Totality: total
Visibility: export
parseBinaryNat : ByteVectn->MaybeNat
Totality: total
Visibility: export
parseInteger : ByteVectn->MaybeInteger
Totality: total
Visibility: export
parseDouble : ByteVectn->MaybeDouble
Totality: total
Visibility: export
putByteVect : Builderq=>ByteVectn->F1'q
Totality: total
Visibility: export