Idris2Doc : Data.ByteString

Data.ByteString

(source)
Immutable strings of raw bytes.

Reexports

importpublic Data.ByteVect as BV

Definitions

null : ByteString->Bool
Totality: total
Visibility: export
length : ByteString->Nat
Totality: total
Visibility: export
index : Nat->ByteString->MaybeBits8
  Tries to read the value of a `ByteString` at the given position

Totality: total
Visibility: export
empty : ByteString
  The empty `ByteString`.

Totality: total
Visibility: export
pack : ListBits8->ByteString
  Converts a list of `Bits8` values to a `ByteString`.

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

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

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

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

Totality: total
Visibility: export
generate : (n : Nat) -> (Finn->Bits8) ->ByteString
Totality: total
Visibility: export
replicate : Nat->Bits8->ByteString
Totality: total
Visibility: export
unsafeByteString : Nat->Buffer->ByteString
Totality: total
Visibility: export
toBuffer : ByteString->IOBuffer
  Copy the given `ByteString` and write its content to a freshly
allocated buffer.

Totality: total
Visibility: export
fromIBuffer : IBuffern->ByteString
  Wrappes an immutable buffer in a `ByteString`

Totality: total
Visibility: export
TotLength : ListByteString->Nat
Totality: total
Visibility: public export
copyMany : (ps : ListByteString) -> (pos : Nat) -> {auto0_ : pos+TotLengthps=n} ->MBuffersn->F1's
Totality: total
Visibility: export
fastConcat : ListByteString->ByteString
  Concatenate a list of `ByteString`. This allocates
a buffer of sufficient size in advance, so it is much
faster than `concat`, or `concatMap` for large `ByteString`s.

Totality: total
Visibility: export
concatSep : ByteString->ListByteString->ByteString
  Concatenates a list of bytestrings, separating them with the
given separator `sep`.

Totality: total
Visibility: export
concatSep1 : Bits8->ListByteString->ByteString
  Concatenates a list of bytestrings, using the given byte to
separate them.

Totality: total
Visibility: export
unixUnlines : ListByteString->ByteString
  Concatenates the given list of bytestring by interspersing them
with Unix linebreaks (byte `0x0A`).

Totality: total
Visibility: export
append : ByteString->ByteString->ByteString
  Concatenate two `ByteString`s. O(n + m).

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

Totality: total
Visibility: export
snoc : Bits8->ByteString->ByteString
  Append a single `Bits8` to a `ByteString`. O(n).

Totality: total
Visibility: export
padLeft : Nat->Bits8->ByteString->ByteString
Totality: total
Visibility: export
padRight : Nat->Bits8->ByteString->ByteString
Totality: total
Visibility: export
head : ByteString->MaybeBits8
  Read the first element of a `ByteString`. O(1).

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

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

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

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

Totality: total
Visibility: export
unsnoc : ByteString->Maybe (Bits8, ByteString)
  Split the last `Bits8` from a `ByteString`. O(1).

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

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

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

Totality: total
Visibility: export
reverse : ByteString->ByteString
Totality: total
Visibility: export
all : (Bits8->Bool) ->ByteString->Bool
  True, if the predicate holds for all bytes in the given `ByteString`

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

Totality: total
Visibility: export
elem : Bits8->ByteString->Bool
  True, if the given `Bits8` appears in the `ByteString`.

Totality: total
Visibility: export
foldl : (a->Bits8->a) ->a->ByteString->a
Totality: total
Visibility: export
foldr : (Bits8->a->a) ->a->ByteString->a
Totality: total
Visibility: export
findIndex : (Bits8->Bool) ->ByteString->MaybeNat
  The `findIndex` function takes a predicate and a `ByteString` and
returns the index of the first element in the ByteString
satisfying the predicate.

Totality: total
Visibility: export
elemIndex : Bits8->ByteString->MaybeNat
  Return the index of the first occurence of the given
byte in the `ByteString`, or `Nothing`, if the byte
does not appear in the ByteString.

Totality: total
Visibility: export
find : (Bits8->Bool) ->ByteString->MaybeBits8
Totality: total
Visibility: export
isInfixOf : ByteString->ByteString->Bool
Totality: total
Visibility: export
isPrefixOf : ByteString->ByteString->Bool
Totality: total
Visibility: export
isSuffixOf : ByteString->ByteString->Bool
Totality: total
Visibility: export
substring : Nat->Nat->ByteString->ByteString
  Like `substr` for `String`, this extracts a substring
of the given `ByteString` at the given start position
and of the given length.

Totality: total
Visibility: export
mapMaybe : (Bits8->MaybeBits8) ->ByteString->ByteString
Totality: total
Visibility: export
filter : (Bits8->Bool) ->ByteString->ByteString
Totality: total
Visibility: export
take : Nat->ByteString->ByteString
  Return a `ByteString` with the first `n` values of
the input string. Returns the whole string if
`k` is larger than the bytestring. O(1)

Totality: total
Visibility: export
takeEnd : Nat->ByteString->ByteString
  Return a `ByteString` with the last `n` values of
the input string. O(1)

Totality: total
Visibility: export
drop : Nat->ByteString->ByteString
  Remove the first `n` values from a `ByteString`. O(1)

Totality: total
Visibility: export
dropEnd : Nat->ByteString->ByteString
  Remove the last `n` values from a `ByteString`. O(1)

Totality: total
Visibility: export
splitAt : Nat->ByteString->Maybe (ByteString, ByteString)
Totality: total
Visibility: export
takeWhile : (Bits8->Bool) ->ByteString->ByteString
  Extracts the longest prefix of elements satisfying the
predicate.

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

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

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

Totality: total
Visibility: export
break : (Bits8->Bool) ->ByteString-> (ByteString, ByteString)
  Returns the longest (possibly empty) prefix of elements which do not
satisfy the predicate and the remainder of the string.

Totality: total
Visibility: export
breakEnd : (Bits8->Bool) ->ByteString-> (ByteString, ByteString)
  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) ->ByteString-> (ByteString, ByteString)
  Returns the longest (possibly empty) prefix of elements
satisfying the predicate and the remainder of the string.

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

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

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

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

Totality: total
Visibility: export
splitWith : (Bits8->Bool) ->ByteString->ListByteString
  Splits a 'ByteString' 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) ->ByteString->ListByteString
  Like `splitWith`, but removes empty components.

Totality: total
Visibility: export
split : Bits8->ByteString->ListByteString
  Break a `ByteString` 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->ByteString->ListByteString
  Like `splitWith`, but removes empty components.

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

Totality: total
Visibility: export
breakDropAtSubstring : ByteString->ByteString-> (ByteString, ByteString)
  Like `breakAtSubstring` but removes the
substring from the remainder

Totality: total
Visibility: export
splitAtSubstring : ByteString->ByteString->ListByteString
  Splits the second bytestring whenever the first called
`sep` occurs.

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

Note: If `sep` is the empty bytestring, `[val]` is returned
as the result.

Totality: total
Visibility: export
unixLines : ByteString->ListByteString
  Breakes the given bytestring at Unix linebreaks (byte `0x0A`).

Totality: total
Visibility: export
breakAround : ByteString->ByteString->ByteString->Maybe (ByteString, (ByteString, ByteString))
  Extracts the string encountered between `start` and `end`
returning a triple containing the prefix, string in the middle,
and suffix.

Note: The `start` and `end` tag will *not*
be included in the resulting triple.

Returns `Nothing` in case the prefix or suffix was the empty string.
In particular, this will return `Nothing` in case `start` or `end`
is the empty string.

Totality: total
Visibility: export
between : ByteString->ByteString->ByteString->MaybeByteString
  Extracts the string encountered between `start` and `end`.

This will look for the *first* occurrence of `start` and
will take everything until (but not including) the *first*
occurrence of `end` after `start`.

Returns `Nothing` if `end` or `start` is the empty string or
either of the two was not found.

Totality: total
Visibility: export
nonEmpty : ByteString->MaybeByteString
  Returns the given byte string wrapped in a `Just` if and only if
it is non-empty.

Totality: total
Visibility: export
manyBetween : ByteString->ByteString->ByteString->ListByteString
  Extracts *all* occurrences of strings encountered between
the given `start` and `end` tags.

Returns an empty list if the start or end tag is the empty
bytestring.

Totality: total
Visibility: export
betweenNonEmpty : ByteString->ByteString->ByteString->MaybeByteString
  Like `between` but returns `Nothing` in case the resulting
bytestring would be empty.

Totality: total
Visibility: export
modBetween : ByteString->ByteString-> (ByteString->ByteString) ->ByteString->ByteString
  Replaces the first byte sequence in the target string
found between the given `start` and `end` tag by
applying the given function.

In case `start` or `end` is the empty string, this will return
the unmodified bytestring.

Totality: total
Visibility: export
modBetweenAll : ByteString->ByteString-> (ByteString->ByteString) ->ByteString->ByteString
  Replaces all byte sequences in the target string
found between the given `start` and `end` tag by
applying the given function to each of them.

In case `start` or `end` is the empty string, this will return
the unmodified bytestring.

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

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

Totality: total
Visibility: export
parseHexadecimalNat : ByteString->MaybeNat
Totality: total
Visibility: export
parseOctalNat : ByteString->MaybeNat
Totality: total
Visibility: export
parseBinaryNat : ByteString->MaybeNat
Totality: total
Visibility: export
parseInteger : ByteString->MaybeInteger
Totality: total
Visibility: export
parseDouble : ByteString->MaybeDouble
Totality: total
Visibility: export
readByteString : HasIOio=>Nat->File->io (EitherFileErrorByteString)
Totality: total
Visibility: export
writeByteVect : HasIOio=>File->ByteVectn->io (Either (FileError, Int) ())
Totality: total
Visibility: export
writeByteString : HasIOio=>File->ByteString->io (Either (FileError, Int) ())
Totality: total
Visibility: export
putByteString : Builderq=>ByteString->F1'q
Totality: total
Visibility: export
getByteString : Builderq=>F1qByteString
Totality: total
Visibility: export