0x0LearnReferenceLibrariesMigration0x0.jmp0x1b.com

0x0 API Reference

Generated by tools/docgen.0x0 from checked .0x0 source files.

lib/core/bytes.0x0

Module: core.bytes

bytes-empty

Type: (∷ (→ Unit Any))

Create an empty byte list.

byte-valid?

Type: (∷ (→ I64 Bool))

Return true when n fits in one unsigned byte.

bytes-cons

Type: (∷ (→ I64 Any Any))

Prepend a byte to a byte list.

bytes-try-cons

Type: (∷ (→ I64 Any Any))

Return a Result containing byte prepended to rest.

bytes-len

Type: (∷ (→ Any I64))

Return the number of bytes.

bytes-at

Type: (∷ (→ Any I64 I64))

Return the byte at index.

bytes-sum

Type: (∷ (→ Any I64))

Return the sum of all bytes.

byte-to-hex

Type: (∷ (→ I64 Text))

Return a two-digit lowercase hexadecimal representation of a byte.

bytes-to-hex

Type: (∷ (→ Any Text))

Return lowercase hexadecimal text for a byte list.

hex-to-bytes

Type: (∷ (→ Text Any))

Decode lowercase or uppercase hexadecimal text into a byte-list Result.

hex-even-length?

Type: (∷ (→ Text I64 I64 Bool))

Return true when the remaining text length is even.

hex-to-bytes-from

Type: (∷ (→ Text I64 I64 Any))

Decode hexadecimal text from an offset into a byte-list Result.

hex-digit

Type: (∷ (→ I64 Text))

Return a lowercase hexadecimal digit for values 0 through 15.

hex-char-value

Type: (∷ (→ Text I64))

Return a hexadecimal character value or -1 when invalid.

hex-char-value-from

Type: (∷ (→ Text Text I64 I64))

Return the index of a hexadecimal character in digits or -1.

lib/core/db.0x0

Module: core.db

db-empty

Type: (∷ (→ Unit Any))

Create an empty table.

db-row

Type: (∷ (→ Text Any Any))

Create a one-field row.

db-row-put

Type: (∷ (→ Any Text Any Any))

Return row with key set to value.

db-insert

Type: (∷ (→ Any Any Any))

Return table with row inserted at the front.

db-count

Type: (∷ (→ Any I64))

Return the number of rows in a table.

db-cell

Type: (∷ (→ Any Text Any))

Return an Option containing a row cell.

db-cell-text-or

Type: (∷ (→ Any Text Text Text))

Return a text cell or a fallback value.

db-find-text

Type: (∷ (→ Any Text Text Any))

Return an Option row whose text cell matches value.

db-update-text

Type: (∷ (→ Any Text Text Text Text Any))

Update the first row with matching text cell.

lib/core/error.0x0

Module: core.error

error-new

Type: (∷ (→ Text Text Any))

Create a structured error value.

error-code

Type: (∷ (→ Any Text))

Return an error code.

error-message

Type: (∷ (→ Any Text))

Return an error message.

error-text

Type: (∷ (→ Any Text))

Render an error as text.

error-result

Type: (∷ (→ Any Any))

Convert an error to a failed Result.

lib/core/file.0x0

Module: core.file

file-read-safe

Type: (∷ (→ Text Any))

Read a safe relative file path into a Result.

file-write-safe

Type: (∷ (→ Text Text Any))

Write text to a safe relative file path and return a Result.

lib/core/json.0x0

Module: core.json

json-get-int

Type: (∷ (→ Text Text Any))

Return an integer field from a flat JSON object as an Option.

json-get-text

Type: (∷ (→ Text Text Any))

Return an unescaped text field from a flat JSON object as an Option.

json-get-bool

Type: (∷ (→ Text Text Any))

Return a boolean field from a flat JSON object as an Option.

json-find-pattern

Type: (∷ (→ Text Text I64 I64 I64 I64))

Return the first index of pattern in src or -1.

json-value-start

Type: (∷ (→ Text I64 I64 I64))

Return the first non-space character after a field colon.

json-skip-space

Type: (∷ (→ Text I64 I64 I64))

Skip JSON whitespace.

json-int-end

Type: (∷ (→ Text I64 I64 I64))

Return the end offset of a JSON integer literal.

json-int-token?

Type: (∷ (→ Text I64 I64 Bool))

Return true when start points at a syntactically valid integer token.

json-string-token?

Type: (∷ (→ Text I64 I64 Bool))

Return true when start points at a quoted JSON text token with a closing quote.

json-bool-token?

Type: (∷ (→ Text I64 I64 Bool))

Return true when start points at a syntactically valid boolean token.

json-value-tail?

Type: (∷ (→ Text I64 I64 Bool))

Return true when a scalar JSON token is followed by whitespace, comma, object end, or EOF.

json-digits-end

Type: (∷ (→ Text I64 I64 I64))

Return the end offset of a run of digits.

json-string-end

Type: (∷ (→ Text I64 I64 I64))

Return the end offset of an unescaped JSON string value.

lib/core/map.0x0

Module: core.map

map-empty

Type: (∷ (→ Unit Any))

Create an empty text-key map.

map-entry

Type: (∷ (→ Text Any Any))

Create a key/value map entry.

map-put

Type: (∷ (→ Any Text Any Any))

Return a map with key set to value.

map-get

Type: (∷ (→ Any Text Any))

Return an Option containing the value for key.

map-has?

Type: (∷ (→ Any Text Bool))

Return true when key exists in the map.

map-remove

Type: (∷ (→ Any Text Any))

Return a map without key.

lib/core/option.0x0

Module: core.option

option-none

Type: (∷ (→ Unit Any))

Create an absent optional value.

option-some

Type: (∷ (→ Any Any))

Create a present optional value.

option-some?

Type: (∷ (→ Any Bool))

Return true when an option contains a value.

option-none?

Type: (∷ (→ Any Bool))

Return true when an option is absent.

option-value

Type: (∷ (→ Any Any))

Return the contained value or panic when absent.

option-value-or

Type: (∷ (→ Any Any Any))

Return the contained value or a fallback.

lib/core/path.0x0

Module: core.path

path-empty?

Type: (∷ (→ Text Bool))

Return true when path is empty.

path-absolute?

Type: (∷ (→ Text Bool))

Return true when path is absolute.

path-parent-traversal?

Type: (∷ (→ Text Bool))

Return true when path contains parent traversal.

path-safe-relative?

Type: (∷ (→ Text Bool))

Return true when path is a safe relative path.

path-join

Type: (∷ (→ Text Text Text))

Join base and leaf path with one slash.

path-contains?

Type: (∷ (→ Text Text Bool))

Return true when haystack contains needle.

path-contains-from?

Type: (∷ (→ Text Text I64 I64 I64 Bool))

Recursive implementation for substring search.

path-starts-with?

Type: (∷ (→ Text Text Bool))

Return true when s starts with prefix.

path-ends-with?

Type: (∷ (→ Text Text Bool))

Return true when s ends with suffix.

lib/core/result.0x0

Module: core.result

result-ok

Type: (∷ (→ Any Any))

Create a successful result.

result-err

Type: (∷ (→ Text Text Any))

Create a failed result with code and message.

result-ok?

Type: (∷ (→ Any Bool))

Return true when a result is successful.

result-err?

Type: (∷ (→ Any Bool))

Return true when a result is failed.

result-value

Type: (∷ (→ Any Any))

Return the success value or panic when failed.

result-value-or

Type: (∷ (→ Any Any Any))

Return the success value or a fallback.

result-error-code

Type: (∷ (→ Any Text))

Return the error code from a failed result.

result-error-message

Type: (∷ (→ Any Text))

Return the error message from a failed result.