aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/booleans.md30
-rw-r--r--docs/builtins.md184
-rw-r--r--docs/bytes.md51
-rw-r--r--docs/integers.md392
-rw-r--r--docs/lists.md678
-rw-r--r--docs/nums.md1144
-rw-r--r--docs/paths.md965
-rw-r--r--docs/sets.md236
-rw-r--r--docs/tables.md167
-rw-r--r--docs/text.md976
-rw-r--r--docs/tomo.175
11 files changed, 19 insertions, 4879 deletions
diff --git a/docs/booleans.md b/docs/booleans.md
index 8961091a..a3ad22d0 100644
--- a/docs/booleans.md
+++ b/docs/booleans.md
@@ -3,32 +3,6 @@
Boolean values have the type `Bool` and can be either `yes` ("true") or `no`
("false").
-## Boolean Functions
+# API
-This documentation provides details on boolean functions available in the API.
-
-- [`func parse(text: Text -> Bool?)`](#parse)
-
-### `parse`
-Converts a string representation of a boolean value into a boolean. Acceptable
-boolean values are case-insensitive variations of `yes`/`no`, `y`/`n`,
-`true`/`false`, `on`/`off`.
-
-```tomo
-func parse(text: Text -> Bool?)
-```
-
-- `text`: The string containing the boolean value.
-
-**Returns:**
-`yes` if the string matches a recognized truthy boolean value; otherwise return `no`.
-
-**Example:**
-```tomo
->> Bool.parse("yes")
-= yes : Bool?
->> Bool.parse("no")
-= no : Bool?
->> Bool.parse("???")
-= none : Bool?
-```
+[API documentation](../api/booleans.md)
diff --git a/docs/builtins.md b/docs/builtins.md
deleted file mode 100644
index f1d8069f..00000000
--- a/docs/builtins.md
+++ /dev/null
@@ -1,184 +0,0 @@
-# Built-in Functions
-
-These are the top-level functions built into Tomo.
-
-- [`func ask(prompt:Text, bold:Bool = yes, force_tty:Bool = yes -> Text?)`](#ask)
-- [`func ask(message:Text? = !Text, status:Int32 = 1[32] -> Void)`](#exit)
-- [`func getenv(name:Text -> Text?)`](#getenv)
-- [`func print(text:Text, newline:Bool = yes -> Void)`](#print)
-- [`func say(text:Text, newline:Bool = yes -> Void)`](#say)
-- [`func setenv(name:Text, value:Text)`](#setenv)
-- [`func sleep(seconds: Num -> Void)`](#sleep)
-- [`func fail(message:Text -> Abort)`](#fail)
-
----
-
-### `ask`
-Gets a line of user input text with a prompt.
-
-```tomo
-func ask(prompt:Text, bold:Bool = yes, force_tty:Bool = yes -> Text?)
-```
-
-- `prompt`: The text to print as a prompt before getting the input.
-- `bold`: Whether or not to print make the prompt appear bold on a console
- using the ANSI escape sequence `\x1b[1m`.
-- `force_tty`: When a program is receiving input from a pipe or writing its
- output to a pipe, this flag (which is enabled by default) forces the program
- to write the prompt to `/dev/tty` and read the input from `/dev/tty`, which
- circumvents the pipe. This means that `foo | ./tomo your-program | baz` will
- still show a visible prompt and read user input, despite the pipes. Setting
- this flag to `no` will mean that the prompt is written to `stdout` and input
- is read from `stdin`, even if those are pipes.
-
-**Returns:**
-A line of user input text without a trailing newline, or empty text if
-something went wrong (e.g. the user hit `Ctrl-D`).
-
-**Example:**
-```tomo
->> ask("What's your name? ")
-= "Arthur Dent"
-```
-
----
-
-### `exit`
-Exits the program with a given status and optionally prints a message.
-
-```tomo
-func exit(message:Text? = !Text, status:Int32 = 1[32] -> Void)
-```
-
-- `message`: If nonempty, this message will be printed (with a newline) before
- exiting.
-- `status`: The status code that the program with exit with (default: 1, which
- is a failure status).
-
-**Returns:**
-This function never returns.
-
-**Example:**
-```tomo
-exit(status=1, "Goodbye forever!")
-```
-
----
-
-### `getenv`
-Gets an environment variable.
-
-```tomo
-func getenv(name:Text -> Text?)
-```
-
-- `name`: The name of the environment variable to get.
-
-**Returns:**
-If set, the environment variable's value, otherwise, `none`.
-
-**Example:**
-```tomo
->> getenv("TERM")
-= "xterm-256color"?
-```
-
----
-
-### `print`
-Prints a message to the console (alias for [`say`](#say)).
-
-```tomo
-func print(text:Text, newline:Bool = yes -> Void)
-```
-
-- `text`: The text to print.
-- `newline`: Whether or not to print a newline after the text.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-print("Hello ", newline=no)
-print("world!")
-```
-
----
-
-### `say`
-Prints a message to the console.
-
-```tomo
-func say(text:Text, newline:Bool = yes -> Void)
-```
-
-- `text`: The text to print.
-- `newline`: Whether or not to print a newline after the text.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-say("Hello ", newline=no)
-say("world!")
-```
-
----
-
-### `setenv`
-Sets an environment variable.
-
-```tomo
-func getenv(name:Text, value:Text -> Void)
-```
-
-- `name`: The name of the environment variable to set.
-- `value`: The new value of the environment variable.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-setenv("FOOBAR", "xyz")
-```
-
----
-
-### `sleep`
-Pause execution for a given number of seconds.
-
-```tomo
-func sleep(seconds: Num -> Void)
-```
-
-- `seconds`: How many seconds to sleep for.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-sleep(1.5)
-```
-
----
-
-### `fail`
-Prints a message to the console, aborts the program, and prints a stack trace.
-
-```tomo
-func fail(message:Text -> Abort)
-```
-
-- `message`: The error message to print.
-
-**Returns:**
-Nothing, aborts the program.
-
-**Example:**
-```tomo
-fail("Oh no!")
-```
diff --git a/docs/bytes.md b/docs/bytes.md
index 2e139622..196d5762 100644
--- a/docs/bytes.md
+++ b/docs/bytes.md
@@ -7,53 +7,6 @@ API methods for `Text` and `Path` that deal with raw binary data, such as
`Path.read_bytes()` and `Text.bytes()`. Byte literals can be written using
the `Byte()` constructor: `Byte(5)`.
-# Byte Methods
+# API
-- [`func hex(byte: Byte, uppercase=no, prefix=yes -> Text)`](#hex)
-- [`func is_between(x: Byte, low: Byte, high: Byte -> Bool)`](#is_between)
-- [`func parse(text: Text -> Byte?)`](#parse)
-- [`func to(first: Byte, last: Byte, step: Int8? = none -> Text)`](#to)
-
----------
-
-## `hex`
-
-TODO: write docs
-
----------
-
-### `is_between`
-Determines if an integer is between two numbers (inclusive).
-
-```tomo
-func is_between(x: Byte, low: Byte, high: Byte -> Bool)
-```
-
-- `x`: The integer to be checked.
-- `low`: The lower bound to check (inclusive).
-- `high`: The upper bound to check (inclusive).
-
-**Returns:**
-`yes` if `low <= x and x <= high`, otherwise `no`
-
-**Example:**
-```tomo
->> Byte(7).is_between(1, 10)
-= yes
->> Byte(7).is_between(100, 200)
-= no
->> Byte(7).is_between(1, 7)
-= yes
-```
-
----
-
-## `parse`
-
-TODO: write docs
-
----------
-
-## `to`
-
-TODO: write docs
+[API documentation](../api/bytes.md)
diff --git a/docs/integers.md b/docs/integers.md
index b37f93ab..6be96880 100644
--- a/docs/integers.md
+++ b/docs/integers.md
@@ -116,394 +116,6 @@ rounding _towards zero_, and modulus never gives negative results:
= yes
```
-## Integer Functions
+# API
-Each integer type has its own version of the following functions. Functions
-can be called either on the type itself: `Int.sqrt(x)` or as a method call:
-`x.sqrt()`. Method call syntax is preferred.
-
-- [`func abs(x: Int -> Int)`](#abs)
-- [`func choose(n: Int, k: Int -> Int)`](#choose)
-- [`func clamped(x, low, high: Int -> Int)`](#clamped)
-- [`func factorial(n: Int -> Text)`](#factorial)
-- [`func format(i: Int, digits: Int = 0 -> Text)`](#format)
-- [`func hex(i: Int, digits: Int = 0, uppercase: Bool = yes, prefix: Bool = yes -> Text)`](#hex)
-- [`func is_between(x: Int, low: Int, high: Int -> Bool)`](#is_between)
-- [`func is_prime(x: Int, reps: Int = 50 -> Bool)`](#is_prime)
-- [`func next_prime(x: Int -> Int)`](#next_prime)
-- [`func octal(i: Int, digits: Int = 0, prefix: Bool = yes -> Text)`](#octal)
-- [`func onward(first: Int, step: Int = 1 -> Text)`](#onward)
-- [`func parse(text: Text -> Int?)`](#parse)
-- [`func prev_prime(x: Int -> Int?)`](#prev_prime)
-- [`func sqrt(x: Int -> Int)`](#sqrt)
-- [`func to(first: Int, last: Int, step : Int? = none -> func(->Int?))`](#to)
-
-### `abs`
-Calculates the absolute value of an integer.
-
-```tomo
-func abs(x: Int -> Int)
-```
-
-- `x`: The integer whose absolute value is to be calculated.
-
-**Returns:**
-The absolute value of `x`.
-
-**Example:**
-```tomo
->> (-10).abs()
-= 10
-```
-
----
-
-### `choose`
-Computes the binomial coefficient of the given numbers (the equivalent of `n`
-choose `k` in combinatorics). This is equal to `n.factorial()/(k.factorial() *
-(n-k).factorial())`.
-
-```tomo
-func choose(n: Int, k: Int -> Int)
-```
-
-- `n`: The number of things to choose from.
-- `k`: The number of things to be chosen.
-
-**Returns:**
-The binomial coefficient, equivalent to the number of ways to uniquely choose
-`k` objects from among `n` objects, ignoring order.
-
-**Example:**
-```tomo
->> (4).choose(2)
-= 6
-```
-
----
-
-### `clamped`
-Returns the given number clamped between two values so that it is within
-that range.
-
-```tomo
-func clamped(x, low, high: Int -> Int)
-```
-
-- `x`: The integer to clamp.
-- `low`: The lowest value the result can take.
-- `high`: The highest value the result can take.
-
-**Returns:**
-The first argument clamped between the other two arguments.
-
-**Example:**
-```tomo
->> (2).clamped(5, 10)
-= 5
-```
-
----
-
-### `factorial`
-Computes the factorial of an integer.
-
-```tomo
-func factorial(n: Int -> Text)
-```
-
-- `n`: The integer to compute the factorial of.
-
-**Returns:**
-The factorial of the given integer.
-
-**Example:**
-```tomo
->> (10).factorial()
-= 3628800
-```
-
----
-
-### `format`
-Formats an integer as a string with a specified number of digits.
-
-```tomo
-func format(i: Int, digits: Int = 0 -> Text)
-```
-
-- `i`: The integer to be formatted.
-- `digits`: The minimum number of digits to which the integer should be padded. Default is `0`.
-
-**Returns:**
-A string representation of the integer, padded to the specified number of digits.
-
-**Example:**
-```tomo
->> (42).format(digits=5)
-= "00042"
-```
-
----
-
-### `hex`
-Converts an integer to its hexadecimal representation.
-
-```tomo
-func hex(i: Int, digits: Int = 0, uppercase: Bool = yes, prefix: Bool = yes -> Text)
-```
-
-- `i`: The integer to be converted.
-- `digits`: The minimum number of digits in the output string. Default is `0`.
-- `uppercase`: Whether to use uppercase letters for hexadecimal digits. Default is `yes`.
-- `prefix`: Whether to include a "0x" prefix. Default is `yes`.
-
-**Returns:**
-The hexadecimal string representation of the integer.
-
-**Example:**
-```tomo
->> (255).hex(digits=4, uppercase=yes, prefix=yes)
-= "0x00FF"
-```
-
----
-
-### `is_between`
-Determines if an integer is between two numbers (inclusive).
-
-```tomo
-func is_between(x: Int, low: Int, high: Int -> Bool)
-```
-
-- `x`: The integer to be checked.
-- `low`: The lower bound to check (inclusive).
-- `high`: The upper bound to check (inclusive).
-
-**Returns:**
-`yes` if `low <= x and x <= high`, otherwise `no`
-
-**Example:**
-```tomo
->> (7).is_between(1, 10)
-= yes
->> (7).is_between(100, 200)
-= no
->> (7).is_between(1, 7)
-= yes
-```
-
----
-
-### `is_prime`
-Determines if an integer is a prime number.
-
-**Note:**
-This function is _probabilistic_. With the default arguments, the chances of
-getting an incorrect answer are astronomically small (on the order of 10^(-30)).
-See [the GNU MP docs](https://gmplib.org/manual/Number-Theoretic-Functions#index-mpz_005fprobab_005fprime_005fp)
-for more details.
-
-```tomo
-func is_prime(x: Int, reps: Int = 50 -> Bool)
-```
-
-- `x`: The integer to be checked.
-- `reps`: The number of repetitions for primality tests. Default is `50`.
-
-**Returns:**
-`yes` if `x` is a prime number, `no` otherwise.
-
-**Example:**
-```tomo
->> (7).is_prime()
-= yes
->> (6).is_prime()
-= no
-```
-
----
-
-### `next_prime`
-Finds the next prime number greater than the given integer.
-
-**Note:**
-This function is _probabilistic_, but the chances of getting an incorrect
-answer are astronomically small (on the order of 10^(-30)).
-See [the GNU MP docs](https://gmplib.org/manual/Number-Theoretic-Functions#index-mpz_005fprobab_005fprime_005fp)
-for more details.
-
-```tomo
-func next_prime(x: Int -> Int)
-```
-
-- `x`: The integer after which to find the next prime.
-
-**Returns:**
-The next prime number greater than `x`.
-
-**Example:**
-```tomo
->> (11).next_prime()
-= 13
-```
-
----
-
-### `octal`
-Converts an integer to its octal representation.
-
-```tomo
-func octal(i: Int, digits: Int = 0, prefix: Bool = yes -> Text)
-```
-
-- `i`: The integer to be converted.
-- `digits`: The minimum number of digits in the output string. Default is `0`.
-- `prefix`: Whether to include a "0o" prefix. Default is `yes`.
-
-**Returns:**
-The octal string representation of the integer.
-
-**Example:**
-```tomo
->> (64).octal(digits=4, prefix=yes)
-= "0o0100"
-```
-
----
-
-### `onward`
-Return an iterator that counts infinitely from the starting integer (with an
-optional step size).
-
-```tomo
-func onward(first: Int, step: Int = 1 -> Text)
-```
-
-- `first`: The starting integer.
-- `step`: The increment step size (default: 1).
-
-**Returns:**
-An iterator function that counts onward from the starting integer.
-
-**Example:**
-```tomo
-nums : &[Int] = &[]
-for i in (5).onward()
- nums.insert(i)
- stop if i == 10
->> nums[]
-= [5, 6, 7, 8, 9, 10]
-```
-
----
-
-### `parse`
-Converts a text representation of an integer into an integer.
-
-```tomo
-func parse(text: Text -> Int?)
-```
-
-- `text`: The text containing the integer.
-
-**Returns:**
-The integer represented by the text. If the given text contains a value outside
-of the representable range or if the entire text can't be parsed as an integer,
-`none` will be returned.
-
-**Example:**
-```tomo
->> Int.parse("123")
-= 123 : Int?
->> Int.parse("0xFF")
-= 255 : Int?
-
-# Can't parse:
->> Int.parse("asdf")
-= none : Int?
-
-# Outside valid range:
->> Int8.parse("9999999")
-= none : Int8?
-```
-
----
-
-### `prev_prime`
-Finds the previous prime number less than the given integer.
-If there is no previous prime number (i.e. if a number less than `2` is
-provided), then the function will create a runtime error.
-
-**Note:**
-This function is _probabilistic_, but the chances of getting an incorrect
-answer are astronomically small (on the order of 10^(-30)).
-See [the GNU MP docs](https://gmplib.org/manual/Number-Theoretic-Functions#index-mpz_005fprobab_005fprime_005fp)
-for more details.
-
-```tomo
-func prev_prime(x: Int -> Int?)
-```
-
-- `x`: The integer before which to find the previous prime.
-
-**Returns:**
-The previous prime number less than `x`, or `none` if `x` is less than 2.
-
-**Example:**
-```tomo
->> (11).prev_prime()
-= 7
-```
-
----
-
-### `sqrt`
-Calculates the square root of an integer.
-
-```tomo
-func sqrt(x: Int -> Int)
-```
-
-- `x`: The integer whose square root is to be calculated.
-
-**Returns:**
-The integer part of the square root of `x`.
-
-**Example:**
-```tomo
->> (16).sqrt()
-= 4
->> (17).sqrt()
-= 4
-```
-
----
-
-### `to`
-Returns an iterator function that iterates over the range of numbers specified.
-Iteration is assumed to be nonempty and
-
-```tomo
-func to(first: Int, last: Int, step : Int? = none -> func(->Int?))
-```
-
-- `first`: The starting value of the range.
-- `last`: The ending value of the range.
-- `step`: An optional step size to use. If unspecified or `none`, the step will be inferred to be `+1` if `last >= first`, otherwise `-1`.
-
-**Returns:**
-An iterator function that returns each integer in the given range (inclusive).
-
-**Example:**
-```tomo
->> (2).to(5)
-= func(->Int?)
->> [x for x in (2).to(5)]
-= [2, 3, 4, 5]
->> [x for x in (5).to(2)]
-= [5, 4, 3, 2]
-
->> [x for x in (2).to(5, step=2)]
-= [2, 4]
-```
+[API documentation](../api/integers.md)
diff --git a/docs/lists.md b/docs/lists.md
index 141f6abd..dfb64aad 100644
--- a/docs/lists.md
+++ b/docs/lists.md
@@ -231,680 +231,6 @@ The TL;DR is: you can cheaply modify local variables that aren't aliased or
`@`-allocated lists, but if you assign a local variable list to another
variable or dereference a heap pointer, it may trigger copy-on-write behavior.
-## List Methods
-
-- [`func binary_search(list: [T], by: func(x,y:&T->Int32) = T.compare -> Int)`](#binary_search)
-- [`func by(list: [T], step: Int -> [T])`](#by)
-- [`func clear(list: @[T] -> Void)`](#clear)
-- [`func counts(list: [T] -> {T=Int})`](#counts)
-- [`func find(list: [T], target: T -> Int?)`](#find)
-- [`func first(list: [T], predicate: func(item:&T -> Bool) -> Int)`](#first)
-- [`func from(list: [T], first: Int -> [T])`](#from)
-- [`func has(list: [T], element: T -> Bool)`](#has)
-- [`func heap_pop(list: @[T], by: func(x,y:&T->Int32) = T.compare -> T?)`](#heap_pop)
-- [`func heap_push(list: @[T], item: T, by=T.compare -> Void)`](#heap_push)
-- [`func heapify(list: @[T], by: func(x,y:&T->Int32) = T.compare -> Void)`](#heapify)
-- [`func insert(list: @[T], item: T, at: Int = 0 -> Void)`](#insert)
-- [`func insert_all(list: @[T], items: [T], at: Int = 0 -> Void)`](#insert_all)
-- [`func pop(list: &[T], index: Int = -1 -> T?)`](#pop)
-- [`func random(list: [T], random: func(min,max:Int64->Int64)? = none -> T)`](#random)
-- [`func remove_at(list: @[T], at: Int = -1, count: Int = 1 -> Void)`](#remove_at)
-- [`func remove_item(list: @[T], item: T, max_count: Int = -1 -> Void)`](#remove_item)
-- [`func reversed(list: [T] -> [T])`](#reversed)
-- [`func sample(list: [T], count: Int, weights: [Num]? = ![Num], random: func(->Num)? = none -> [T])`](#sample)
-- [`func shuffle(list: @[T], random: func(min,max:Int64->Int64)? = none -> Void)`](#shuffle)
-- [`func shuffled(list: [T], random: func(min,max:Int64->Int64)? = none -> [T])`](#shuffled)
-- [`func slice(list: [T], from: Int, to: Int -> [T])`](#slice)
-- [`func sort(list: @[T], by=T.compare -> Void)`](#sort)
-- [`sorted(list: [T], by=T.compare -> [T])`](#sorted)
-- [`to(list: [T], last: Int -> [T])`](#to)
-- [`unique(list: [T] -> {T})`](#unique)
-
-### `binary_search`
-Performs a binary search on a sorted list.
+# API
-```tomo
-func binary_search(list: [T], by: func(x,y:&T->Int32) = T.compare -> Int)
-```
-
-- `list`: The sorted list to search.
-- `by`: The comparison function used to determine order. If not specified, the
- default comparison function for the item type will be used.
-
-**Returns:**
-Assuming the input list is sorted according to the given comparison function,
-return the index where the given item would be inserted to maintain the sorted
-order. That is, if the item is found, return its index, otherwise return the
-place where it would be found if it were inserted and the list were sorted.
-
-**Example:**
-```tomo
->> [1, 3, 5, 7, 9].binary_search(5)
-= 3
-
->> [1, 3, 5, 7, 9].binary_search(-999)
-= 1
-
->> [1, 3, 5, 7, 9].binary_search(999)
-= 6
-```
-
----
-
-### `by`
-Creates a new list with elements spaced by the specified step value.
-
-```tomo
-func by(list: [T], step: Int -> [T])
-```
-
-- `list`: The original list.
-- `step`: The step value for selecting elements.
-
-**Returns:**
-A new list with every `step`-th element from the original list.
-
-**Example:**
-```tomo
->> [1, 2, 3, 4, 5, 6].by(2)
-= [1, 3, 5]
-```
-
----
-
-### `clear`
-Clears all elements from the list.
-
-```tomo
-func clear(list: @[T] -> Void)
-```
-
-- `list`: The mutable reference to the list to be cleared.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> my_list.clear()
-```
-
----
-
-### `counts`
-Counts the occurrences of each element in the list.
-
-```tomo
-func counts(list: [T] -> {T=Int})
-```
-
-- `list`: The list to count elements in.
-
-**Returns:**
-A table mapping each element to its count.
-
-**Example:**
-```tomo
->> [10, 20, 30, 30, 30].counts()
-= {10=1, 20=1, 30=3}
-```
-
----
-
-### `find`
-Finds the index of the first occurrence of an element (if any).
-
-```tomo
-func find(list: [T], target: T -> Int?)
-```
-
-- `list`: The list to search through.
-- `item`: The item to find in the list.
-
-**Returns:**
-The index of the first occurrence or `!Int` if not found.
-
-**Example:**
-```tomo
->> [10, 20, 30, 40, 50].find(20)
-= 2 : Int?
-
->> [10, 20, 30, 40, 50].find(9999)
-= none : Int?
-```
-
----
-
-### `first`
-Find the index of the first item that matches a predicate function (if any).
-
-```tomo
-func first(list: [T], predicate: func(item:&T -> Bool) -> Int)
-```
-
-- `list`: The list to search through.
-- `predicate`: A function that returns `yes` if the item should be returned or
- `no` if it should not.
-
-**Returns:**
-Returns the index of the first item where the predicate is true or `!Int` if no
-item matches.
-
-**Example:**
-```tomo
->> [4, 5, 6].find(func(i:&Int): i.is_prime())
-= 5 : Int?
->> [4, 6, 8].find(func(i:&Int): i.is_prime())
-= none : Int?
-```
-
----
-
-### `from`
-Returns a slice of the list starting from a specified index.
-
-```tomo
-func from(list: [T], first: Int -> [T])
-```
-
-- `list`: The original list.
-- `first`: The index to start from.
-
-**Returns:**
-A new list starting from the specified index.
-
-**Example:**
-```tomo
->> [10, 20, 30, 40, 50].from(3)
-= [30, 40, 50]
-```
-
----
-
-### `has`
-Checks if the list has an element.
-
-```tomo
-func has(list: [T], element: T -> Bool)
-```
-
-- `list`: The list to check.
-- `target`: The element to check for.
-
-**Returns:**
-`yes` if the list has the target, `no` otherwise.
-
-**Example:**
-```tomo
->> [10, 20, 30].has(20)
-= yes
-```
-
----
-
-### `heap_pop`
-Removes and returns the top element of a heap or `none` if the list is empty.
-By default, this is the *minimum* value in the heap.
-
-```tomo
-func heap_pop(list: @[T], by: func(x,y:&T->Int32) = T.compare -> T?)
-```
-
-- `list`: The mutable reference to the heap.
-- `by`: The comparison function used to determine order. If not specified, the
- default comparison function for the item type will be used.
-
-**Returns:**
-The removed top element of the heap or `none` if the list is empty.
-
-**Example:**
-```tomo
->> my_heap := [30, 10, 20]
->> my_heap.heapify()
->> my_heap.heap_pop()
-= 10
-```
-
----
-
-### `heap_push`
-Adds an element to the heap and maintains the heap property. By default, this
-is a *minimum* heap.
-
-```tomo
-func heap_push(list: @[T], item: T, by=T.compare -> Void)
-```
-
-- `list`: The mutable reference to the heap.
-- `item`: The item to be added.
-- `by`: The comparison function used to determine order. If not specified, the
- default comparison function for the item type will be used.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> my_heap.heap_push(10)
-```
-
----
-
-### `heapify`
-Converts a list into a heap.
-
-```tomo
-func heapify(list: @[T], by: func(x,y:&T->Int32) = T.compare -> Void)
-```
-
-- `list`: The mutable reference to the list to be heapified.
-- `by`: The comparison function used to determine order. If not specified, the
- default comparison function for the item type will be used.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> my_heap := [30, 10, 20]
->> my_heap.heapify()
-```
-
----
-
-### `insert`
-Inserts an element at a specified position in the list.
-
-```tomo
-func insert(list: @[T], item: T, at: Int = 0 -> Void)
-```
-
-- `list`: The mutable reference to the list.
-- `item`: The item to be inserted.
-- `at`: The index at which to insert the item (default is `0`). Since indices
- are 1-indexed and negative indices mean "starting from the back", an index of
- `0` means "after the last item".
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> list := [10, 20]
->> list.insert(30)
->> list
-= [10, 20, 30]
-
->> list.insert(999, at=2)
->> list
-= [10, 999, 20, 30]
-```
-
----
-
-### `insert_all`
-Inserts a list of items at a specified position in the list.
-
-```tomo
-func insert_all(list: @[T], items: [T], at: Int = 0 -> Void)
-```
-
-- `list`: The mutable reference to the list.
-- `items`: The items to be inserted.
-- `at`: The index at which to insert the item (default is `0`). Since indices
- are 1-indexed and negative indices mean "starting from the back", an index of
- `0` means "after the last item".
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-list := [10, 20]
-list.insert_all([30, 40])
->> list
-= [10, 20, 30, 40]
-
-list.insert_all([99, 100], at=2)
->> list
-= [10, 99, 100, 20, 30, 40]
-```
-
----
-
-### `pop`
-Removes and returns an item from the list. If the given index is present in
-the list, the item at that index will be removed and the list will become one
-element shorter.
-
-```tomo
-func pop(list: &[T], index: Int = -1 -> T?)
-```
-
-- `list`: The list to remove an item from.
-- `index`: The index from which to remove the item (default: the last item).
-
-**Returns:**
-`none` if the list is empty or the given index does not exist in the list,
-otherwise the item at the given index.
-
-**Example:**
-```tomo
->> list := [10, 20, 30, 40]
-
->> list.pop()
-= 40
->> list
-= &[10, 20, 30]
-
->> list.pop(index=2)
-= 20
->> list
-= &[10, 30]
-```
-
----
-
-### `random`
-Selects a random element from the list.
-
-```tomo
-func random(list: [T], random: func(min,max:Int64->Int64)? = none -> T)
-```
-
-- `list`: The list from which to select a random element.
-- `random`: If provided, this function will be used to get a random index in the list. Returned
- values must be between `min` and `max` (inclusive). (Used for deterministic pseudorandom number
- generation)
-
-**Returns:**
-A random element from the list.
-
-**Example:**
-```tomo
->> [10, 20, 30].random()
-= 20
-```
-
----
-
-### `remove_at`
-Removes elements from the list starting at a specified index.
-
-```tomo
-func remove_at(list: @[T], at: Int = -1, count: Int = 1 -> Void)
-```
-
-- `list`: The mutable reference to the list.
-- `at`: The index at which to start removing elements (default is `-1`, which means the end of the list).
-- `count`: The number of elements to remove (default is `1`).
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-list := [10, 20, 30, 40, 50]
-list.remove_at(2)
->> list
-= [10, 30, 40, 50]
-
-list.remove_at(2, count=2)
->> list
-= [10, 50]
-```
-
----
-
-### `remove_item`
-Removes all occurrences of a specified item from the list.
-
-```tomo
-func remove_item(list: @[T], item: T, max_count: Int = -1 -> Void)
-```
-
-- `list`: The mutable reference to the list.
-- `item`: The item to be removed.
-- `max_count`: The maximum number of occurrences to remove (default is `-1`, meaning all occurrences).
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-list := [10, 20, 10, 20, 30]
-list.remove_item(10)
->> list
-= [20, 20, 30]
-
-list.remove_item(20, max_count=1)
->> list
-= [20, 30]
-```
-
----
-
-### `reversed`
-Returns a reversed slice of the list.
-
-```tomo
-func reversed(list: [T] -> [T])
-```
-
-- `list`: The list to be reversed.
-
-**Returns:**
-A slice of the list with elements in reverse order.
-
-**Example:**
-```tomo
->> [10, 20, 30].reversed()
-= [30, 20, 10]
-```
-
----
-
-### `sample`
-Selects a sample of elements from the list, optionally with weighted
-probabilities.
-
-```tomo
-func sample(list: [T], count: Int, weights: [Num]? = ![Num], random: func(->Num)? = none -> [T])
-```
-
-- `list`: The list to sample from.
-- `count`: The number of elements to sample.
-- `weights`: The probability weights for each element in the list. These
- values do not need to add up to any particular number, they are relative
- weights. If no weights are given, elements will be sampled with uniform
- probability.
-- `random`: If provided, this function will be used to get random values for
- sampling the list. The provided function should return random numbers
- between `0.0` (inclusive) and `1.0` (exclusive). (Used for deterministic
- pseudorandom number generation)
-
-**Errors:**
-Errors will be raised if any of the following conditions occurs:
-- The given list has no elements and `count >= 1`
-- `count < 0` (negative count)
-- The number of weights provided doesn't match the length of the list.
-- Any weight in the weights list is negative, infinite, or `NaN`
-- The sum of the given weights is zero (zero probability for every element).
-
-**Returns:**
-A list of sampled elements from the list.
-
-**Example:**
-```tomo
->> [10, 20, 30].sample(2, weights=[90%, 5%, 5%])
-= [10, 10]
-```
-
----
-
-### `shuffle`
-Shuffles the elements of the list in place.
-
-```tomo
-func shuffle(list: @[T], random: func(min,max:Int64->Int64)? = none -> Void)
-```
-
-- `list`: The mutable reference to the list to be shuffled.
-- `random`: If provided, this function will be used to get a random index in the list. Returned
- values must be between `min` and `max` (inclusive). (Used for deterministic pseudorandom number
- generation)
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> list.shuffle()
-```
-
----
-
-### `shuffled`
-Creates a new list with elements shuffled.
-
-```tomo
-func shuffled(list: [T], random: func(min,max:Int64->Int64)? = none -> [T])
-```
-
-- `list`: The list to be shuffled.
-- `random`: If provided, this function will be used to get a random index in the list. Returned
- values must be between `min` and `max` (inclusive). (Used for deterministic pseudorandom number
- generation)
-
-**Returns:**
-A new list with shuffled elements.
-
-**Example:**
-```tomo
->> [10, 20, 30, 40].shuffled()
-= [40, 10, 30, 20]
-```
-
----
-
-### `slice`
-Returns a slice of the list spanning the given indices (inclusive).
-
-```tomo
-func slice(list: [T], from: Int, to: Int -> [T])
-```
-
-- `list`: The original list.
-- `from`: The first index to include.
-- `to`: The last index to include.
-
-**Returns:**
-A new list spanning the given indices. Note: negative indices are counted from
-the back of the list, so `-1` refers to the last element, `-2` the
-second-to-last, and so on.
-
-**Example:**
-```tomo
->> [10, 20, 30, 40, 50].slice(2, 4)
-= [20, 30, 40]
-
->> [10, 20, 30, 40, 50].slice(-3, -2)
-= [30, 40]
-```
-
----
-
-### `sort`
-Sorts the elements of the list in place in ascending order (small to large).
-
-```tomo
-func sort(list: @[T], by=T.compare -> Void)
-```
-
-- `list`: The mutable reference to the list to be sorted.
-- `by`: The comparison function used to determine order. If not specified, the
- default comparison function for the item type will be used.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-list := [40, 10, -30, 20]
-list.sort()
->> list
-= [-30, 10, 20, 40]
-
-list.sort(func(a,b:&Int): a.abs() <> b.abs())
->> list
-= [10, 20, -30, 40]
-```
-
----
-
-### `sorted`
-Creates a new list with elements sorted.
-
-```tomo
-func sorted(list: [T], by=T.compare -> [T])
-```
-
-- `list`: The list to be sorted.
-- `by`: The comparison function used to determine order. If not specified, the
- default comparison function for the item type will be used.
-
-**Returns:**
-A new list with sorted elements.
-
-**Example:**
-```tomo
->> [40, 10, -30, 20].sorted()
-= [-30, 10, 20, 40]
-
->> [40, 10, -30, 20].sorted(func(a,b:&Int): a.abs() <> b.abs())
-= [10, 20, -30, 40]
-```
-
----
-
-### `to`
-Returns a slice of the list from the start of the original list up to a specified index (inclusive).
-
-```tomo
-func to(list: [T], last: Int -> [T])
-```
-
-- `list`: The original list.
-- `last`: The index up to which elements should be included.
-
-**Returns:**
-A new list containing elements from the start up to the specified index.
-
-**Example:**
-```tomo
->> [10, 20, 30, 40, 50].to(3)
-= [10, 20, 30]
-
->> [10, 20, 30, 40, 50].to(-2)
-= [10, 20, 30, 40]
-```
-
----
-
-### `unique`
-Returns a Set that contains the unique elements of the list.
-
-```tomo
-func unique(list: [T] -> |T|)
-```
-
-- `list`: The list to process.
-
-**Returns:**
-A set containing only unique elements from the list.
-
-**Example:**
-```tomo
->> [10, 20, 10, 10, 30].unique()
-= {10, 20, 30}
-```
+[API documentation](../api/lists.md)
diff --git a/docs/nums.md b/docs/nums.md
index c209d74d..1bd9b52d 100644
--- a/docs/nums.md
+++ b/docs/nums.md
@@ -94,1146 +94,6 @@ eliminating conditional branching inside of compound math expressions. Users
should also be able to write code that can safely assume that all values
provided are not NaN.
-## Constants
+# API
-- **`1_PI`**: \( \frac{1}{\pi} \)
-- **`2_PI`**: \( 2 \times \pi \)
-- **`2_SQRTPI`**: \( 2 \times \sqrt{\pi} \)
-- **`E`**: Base of natural logarithms (\( e \))
-- **`INF`**: Positive infinity
-- **`LN10`**: Natural logarithm of 10
-- **`LN2`**: Natural logarithm of 2
-- **`LOG2E`**: Logarithm base 2 of \( e \)
-- **`PI`**: Pi (\( \pi \))
-- **`PI_2`**: \( \frac{\pi}{2} \)
-- **`PI_4`**: \( \frac{\pi}{4} \)
-- **`SQRT1_2`**: \( \sqrt{\frac{1}{2}} \)
-- **`SQRT2`**: \( \sqrt{2} \)
-- **`TAU`**: Tau (\( 2 \times \pi \))
-
-## Functions
-
-Each Num type has its own version of the following functions. Functions can be
-called either on the type itself: `Num.sqrt(x)` or as a method call:
-`x.sqrt()`. Method call syntax is preferred.
-
----
-
-- [`func abs(n: Num -> Num)`](#abs)
-- [`func acos(x: Num -> Num)`](#acos)
-- [`func acosh(x: Num -> Num)`](#acosh)
-- [`func asin(x: Num -> Num)`](#asin)
-- [`func asinh(x: Num -> Num)`](#asinh)
-- [`func atan(x: Num -> Num)`](#atan)
-- [`func atan2(x: Num, y: Num -> Num)`](#atan2)
-- [`func atanh(x: Num -> Num)`](#atanh)
-- [`func cbrt(x: Num -> Num)`](#cbrt)
-- [`func ceil(x: Num -> Num)`](#ceil)
-- [`func clamped(x, low, high: Num -> Num)`](#clamped)
-- [`func copysign(x: Num, y: Num -> Num)`](#copysign)
-- [`func cos(x: Num -> Num)`](#cos)
-- [`func cosh(x: Num -> Num)`](#cosh)
-- [`func erf(x: Num -> Num)`](#erf)
-- [`func erfc(x: Num -> Num)`](#erfc)
-- [`func exp(x: Num -> Num)`](#exp)
-- [`func exp2(x: Num -> Num)`](#exp2)
-- [`func expm1(x: Num -> Num)`](#expm1)
-- [`func fdim(x: Num, y: Num -> Num)`](#fdim)
-- [`func floor(x: Num -> Num)`](#floor)
-- [`func format(n: Num, precision: Int = 0 -> Text)`](#format)
-- [`func hypot(x: Num, y: Num -> Num)`](#hypot)
-- [`func isfinite(n: Num -> Bool)`](#isfinite)
-- [`func is_between(n: Num, low: Num, high: Num -> Bool)`](#is_between)
-- [`func isinf(n: Num -> Bool)`](#isinf)
-- [`func j0(x: Num -> Num)`](#j0)
-- [`func j1(x: Num -> Num)`](#j1)
-- [`func log(x: Num -> Num)`](#log)
-- [`func log10(x: Num -> Num)`](#log10)
-- [`func log1p(x: Num -> Num)`](#log1p)
-- [`func log2(x: Num -> Num)`](#log2)
-- [`func logb(x: Num -> Num)`](#logb)
-- [`func mix(amount: Num, x: Num, y: Num -> Num)`](#mix)
-- [`func near(x: Num, y: Num, ratio: Num = 1e-9, min_epsilon: Num = 1e-9 -> Bool)`](#near)
-- [`func nextafter(x: Num, y: Num -> Num)`](#nextafter)
-- [`func parse(text: Text -> Num?)`](#parse)
-- [`func percent(n: Num -> Text)`](#percent)
-- [`func rint(x: Num -> Num)`](#rint)
-- [`func round(x: Num -> Num)`](#round)
-- [`func scientific(n: Num, precision: Int = 0 -> Text)`](#scientific)
-- [`func significand(x: Num -> Num)`](#significand)
-- [`func sin(x: Num -> Num)`](#sin)
-- [`func sinh(x: Num -> Num)`](#sinh)
-- [`func sqrt(x: Num -> Num)`](#sqrt)
-- [`func tan(x: Num -> Num)`](#tan)
-- [`func tanh(x: Num -> Num)`](#tanh)
-- [`func tgamma(x: Num -> Num)`](#tgamma)
-- [`func trunc(x: Num -> Num)`](#trunc)
-- [`func y0(x: Num -> Num)`](#y0)
-- [`func y1(x: Num -> Num)`](#y1)
-
-### `abs`
-Calculates the absolute value of a number.
-
-```tomo
-func abs(n: Num -> Num)
-```
-
-- `n`: The number whose absolute value is to be computed.
-
-**Returns:**
-The absolute value of `n`.
-
-**Example:**
-```tomo
->> (-3.5).abs()
-= 3.5
-```
-
----
-
-### `acos`
-Computes the arc cosine of a number.
-
-```tomo
-func acos(x: Num -> Num)
-```
-
-- `x`: The number for which the arc cosine is to be calculated.
-
-**Returns:**
-The arc cosine of `x` in radians.
-
-**Example:**
-```tomo
->> (0.0).acos() // -> (π/2)
-= 1.5708
-```
-
----
-
-### `acosh`
-Computes the inverse hyperbolic cosine of a number.
-
-```tomo
-func acosh(x: Num -> Num)
-```
-
-- `x`: The number for which the inverse hyperbolic cosine is to be calculated.
-
-**Returns:**
-The inverse hyperbolic cosine of `x`.
-
-**Example:**
-```tomo
->> (1.0).acosh()
-= 0
-```
-
----
-
-### `asin`
-Computes the arc sine of a number.
-
-```tomo
-func asin(x: Num -> Num)
-```
-
-- `x`: The number for which the arc sine is to be calculated.
-
-**Returns:**
-The arc sine of `x` in radians.
-
-**Example:**
-```tomo
->> (0.5).asin() // -> (π/6)
-= 0.5236
-```
-
----
-
-### `asinh`
-Computes the inverse hyperbolic sine of a number.
-
-```tomo
-func asinh(x: Num -> Num)
-```
-
-- `x`: The number for which the inverse hyperbolic sine is to be calculated.
-
-**Returns:**
-The inverse hyperbolic sine of `x`.
-
-**Example:**
-```tomo
->> (0.0).asinh()
-= 0
-```
-
----
-
-### `atan`
-Computes the arc tangent of a number.
-
-```tomo
-func atan(x: Num -> Num)
-```
-
-- `x`: The number for which the arc tangent is to be calculated.
-
-**Returns:**
-The arc tangent of `x` in radians.
-
-**Example:**
-```tomo
->> (1.0).atan() // -> (π/4)
-= 0.7854
-```
-
----
-
-### `atan2`
-Computes the arc tangent of the quotient of two numbers.
-
-```tomo
-func atan2(x: Num, y: Num -> Num)
-```
-
-- `x`: The numerator.
-- `y`: The denominator.
-
-**Returns:**
-The arc tangent of `x/y` in radians.
-
-**Example:**
-```tomo
->> Num.atan2(1, 1) // -> (π/4)
-= 0.7854
-```
-
----
-
-### `atanh`
-Computes the inverse hyperbolic tangent of a number.
-
-```tomo
-func atanh(x: Num -> Num)
-```
-
-- `x`: The number for which the inverse hyperbolic tangent is to be calculated.
-
-**Returns:**
-The inverse hyperbolic tangent of `x`.
-
-**Example:**
-```tomo
->> (0.5).atanh()
-= 0.5493
-```
-
----
-
-### `cbrt`
-Computes the cube root of a number.
-
-```tomo
-func cbrt(x: Num -> Num)
-```
-
-- `x`: The number for which the cube root is to be calculated.
-
-**Returns:**
-The cube root of `x`.
-
-**Example:**
-```tomo
->> (27.0).cbrt()
-= 3
-```
-
----
-
-### `ceil`
-Rounds a number up to the nearest integer.
-
-```tomo
-func ceil(x: Num -> Num)
-```
-
-- `x`: The number to be rounded up.
-
-**Returns:**
-The smallest integer greater than or equal to `x`.
-
-**Example:**
-```tomo
->> (3.2).ceil()
-= 4
-```
-
----
-
-### `clamped`
-Returns the given number clamped between two values so that it is within
-that range.
-
-```tomo
-func clamped(x, low, high: Num -> Num)
-```
-
-- `x`: The number to clamp.
-- `low`: The lowest value the result can take.
-- `high`: The highest value the result can take.
-
-**Returns:**
-The first argument clamped between the other two arguments.
-
-**Example:**
-```tomo
->> (2.5).clamped(5.5, 10.5)
-= 5.5
-```
-
----
-
-### `copysign`
-Copies the sign of one number to another.
-
-```tomo
-func copysign(x: Num, y: Num -> Num)
-```
-
-- `x`: The number whose magnitude will be copied.
-- `y`: The number whose sign will be copied.
-
-**Returns:**
-A number with the magnitude of `x` and the sign of `y`.
-
-**Example:**
-```tomo
->> (3.0).copysign(-1)
-= -3
-```
-
----
-
-### `cos`
-Computes the cosine of a number (angle in radians).
-
-```tomo
-func cos(x: Num -> Num)
-```
-
-- `x`: The angle in radians.
-
-**Returns:**
-The cosine of `x`.
-
-**Example:**
-```tomo
->> (0.0).cos()
-= 1
-```
-
----
-
-### `cosh`
-Computes the hyperbolic cosine of a number.
-
-```tomo
-func cosh(x: Num -> Num)
-```
-
-- `x`: The number for which the hyperbolic cosine is to be calculated.
-
-**Returns:**
-The hyperbolic cosine of `x`.
-
-**Example:**
-```tomo
->> (0.0).cosh()
-= 1
-```
-
----
-
-### `erf`
-Computes the error function of a number.
-
-```tomo
-func erf(x: Num -> Num)
-```
-
-- `x`: The number for which the error function is to be calculated.
-
-**Returns:**
-The error function of `x`.
-
-**Example:**
-```tomo
->> (0.0).erf()
-= 0
-```
-
----
-
-### `erfc`
-Computes the complementary error function of a number.
-
-```tomo
-func erfc(x: Num -> Num)
-```
-
-- `x`: The number for which the complementary error function is to be calculated.
-
-**Returns:**
-The complementary error function of `x`.
-
-**Example:**
-```tomo
->> (0.0).erfc()
-= 1
-```
-
----
-
-### `exp`
-Computes the exponential function \( e^x \) for a number.
-
-```tomo
-func exp(x: Num -> Num)
-```
-
-- `x`: The exponent.
-
-**Returns:**
-The value of \( e^x \).
-
-**Example:**
-```tomo
->> (1.0).exp()
-= 2.7183
-```
-
----
-
-### `exp2`
-Computes \( 2^x \) for a number.
-
-```tomo
-func exp2(x: Num -> Num)
-```
-
-- `x`: The exponent.
-
-**Returns:**
-The value of \( 2^x \).
-
-**Example:**
-```tomo
->> (3.0).exp2()
-= 8
-```
-
----
-
-### `expm1`
-Computes \( e^x - 1 \) for a number.
-
-```tomo
-func expm1(x: Num -> Num)
-```
-
-- `x`: The exponent.
-
-**Returns:**
-The value of \( e^x - 1 \).
-
-**Example:**
-```tomo
->> (1.0).expm1()
-= 1.7183
-```
-
----
-
-### `fdim`
-Computes the positive difference between two numbers.
-
-```tomo
-func fdim(x: Num, y: Num -> Num)
-```
-
-- `x`: The first number.
-- `y`: The second number.
-
-**Returns:**
-The positive difference \( \max(0, x - y) \).
-
-**Example:**
-```tomo
-fd
-
->> (5.0).fdim(3)
-= 2
-```
-
----
-
-### `floor`
-Rounds a number down to the nearest integer.
-
-```tomo
-func floor(x: Num -> Num)
-```
-
-- `x`: The number to be rounded down.
-
-**Returns:**
-The largest integer less than or equal to `x`.
-
-**Example:**
-```tomo
->> (3.7).floor()
-= 3
-```
-
----
-
-### `format`
-Formats a number as a text with a specified precision.
-
-```tomo
-func format(n: Num, precision: Int = 0 -> Text)
-```
-
-- `n`: The number to be formatted.
-- `precision`: The number of decimal places. Default is `0`.
-
-**Returns:**
-A text representation of the number with the specified precision.
-
-**Example:**
-```tomo
->> (3.14159).format(precision=2)
-= "3.14"
-```
-
----
-
-### `hypot`
-Computes the Euclidean norm, \( \sqrt{x^2 + y^2} \), of two numbers.
-
-```tomo
-func hypot(x: Num, y: Num -> Num)
-```
-
-- `x`: The first number.
-- `y`: The second number.
-
-**Returns:**
-The Euclidean norm of `x` and `y`.
-
-**Example:**
-```tomo
->> Num.hypot(3, 4)
-= 5
-```
-
----
-
-### `isfinite`
-Checks if a number is finite.
-
-```tomo
-func isfinite(n: Num -> Bool)
-```
-
-- `n`: The number to be checked.
-
-**Returns:**
-`yes` if `n` is finite, `no` otherwise.
-
-**Example:**
-```tomo
->> (1.0).isfinite()
-= yes
->> Num.INF.isfinite()
-= no
-```
-
----
-
-### `is_between`
-Determines if a number is between two numbers (inclusive).
-
-```tomo
-func is_between(x: Num, low: Num, high: Num -> Bool)
-```
-
-- `x`: The integer to be checked.
-- `low`: The lower bound to check (inclusive).
-- `high`: The upper bound to check (inclusive).
-
-**Returns:**
-`yes` if `low <= x and x <= high`, otherwise `no`
-
-**Example:**
-```tomo
->> (7.5).is_between(1, 10)
-= yes
->> (7.5).is_between(100, 200)
-= no
->> (7.5).is_between(1, 7.5)
-= yes
-```
-
----
-
-### `isinf`
-Checks if a number is infinite.
-
-```tomo
-func isinf(n: Num -> Bool)
-```
-
-- `n`: The number to be checked.
-
-**Returns:**
-`yes` if `n` is infinite, `no` otherwise.
-
-**Example:**
-```tomo
->> Num.INF.isinf()
-= yes
->> (1.0).isinf()
-= no
-```
-
----
-
-### `j0`
-Computes the Bessel function of the first kind of order 0.
-
-```tomo
-func j0(x: Num -> Num)
-```
-
-- `x`: The number for which the Bessel function is to be calculated.
-
-**Returns:**
-The Bessel function of the first kind of order 0 of `x`.
-
-**Example:**
-```tomo
->> (0.0).j0()
-= 1
-```
-
----
-
-### `j1`
-Computes the Bessel function of the first kind of order 1.
-
-```tomo
-func j1(x: Num -> Num)
-```
-
-- `x`: The number for which the Bessel function is to be calculated.
-
-**Returns:**
-The Bessel function of the first kind of order 1 of `x`.
-
-**Example:**
-```tomo
->> (0.0).j1()
-= 0
-```
-
----
-
-### `log`
-Computes the natural logarithm (base \( e \)) of a number.
-
-```tomo
-func log(x: Num -> Num)
-```
-
-- `x`: The number for which the natural logarithm is to be calculated.
-
-**Returns:**
-The natural logarithm of `x`.
-
-**Example:**
-```tomo
->> Num.E.log()
-= 1
-```
-
----
-
-### `log10`
-Computes the base-10 logarithm of a number.
-
-```tomo
-func log10(x: Num -> Num)
-```
-
-- `x`: The number for which the base-10 logarithm is to be calculated.
-
-**Returns:**
-The base-10 logarithm of `x`.
-
-**Example:**
-```tomo
->> (100.0).log10()
-= 2
-```
-
----
-
-### `log1p`
-Computes \( \log(1 + x) \) for a number.
-
-```tomo
-func log1p(x: Num -> Num)
-```
-
-- `x`: The number for which \( \log(1 + x) \) is to be calculated.
-
-**Returns:**
-The value of \( \log(1 + x) \).
-
-**Example:**
-```tomo
->> (1.0).log1p()
-= 0.6931
-```
-
----
-
-### `log2`
-Computes the base-2 logarithm of a number.
-
-```tomo
-func log2(x: Num -> Num)
-```
-
-- `x`: The number for which the base-2 logarithm is to be calculated.
-
-**Returns:**
-The base-2 logarithm of `x`.
-
-**Example:**
-```tomo
->> (8.0).log2()
-= 3
-```
-
----
-
-### `logb`
-Computes the binary exponent (base-2 logarithm) of a number.
-
-```tomo
-func logb(x: Num -> Num)
-```
-
-- `x`: The number for which the binary exponent is to be calculated.
-
-**Returns:**
-The binary exponent of `x`.
-
-**Example:**
-```tomo
->> (8.0).logb()
-= 3
-```
-
----
-
-### `mix`
-Interpolates between two numbers based on a given amount.
-
-```tomo
-func mix(amount: Num, x: Num, y: Num -> Num)
-```
-
-- `amount`: The interpolation factor (between `0` and `1`).
-- `x`: The starting number.
-- `y`: The ending number.
-
-**Returns:**
-The interpolated number between `x` and `y` based on `amount`.
-
-**Example:**
-```tomo
->> (0.5).mix(10, 20)
-= 15
->> (0.25).mix(10, 20)
-= 12.5
-```
-
----
-
-### `near`
-Checks if two numbers are approximately equal within specified tolerances. If
-two numbers are within an absolute difference or the ratio between the two is
-small enough, they are considered near each other.
-
-```tomo
-func near(x: Num, y: Num, ratio: Num = 1e-9, min_epsilon: Num = 1e-9 -> Bool)
-```
-
-- `x`: The first number.
-- `y`: The second number.
-- `ratio`: The relative tolerance. Default is `1e-9`.
-- `min_epsilon`: The absolute tolerance. Default is `1e-9`.
-
-**Returns:**
-`yes` if `x` and `y` are approximately equal within the specified tolerances, `no` otherwise.
-
-**Example:**
-```tomo
->> (1.0).near(1.000000001)
-= yes
-
->> (100.0).near(110, ratio=0.1)
-= yes
-
->> (5.0).near(5.1, min_epsilon=0.1)
-= yes
-```
-
----
-
-### `nextafter`
-Computes the next representable value after a given number towards a specified direction.
-
-```tomo
-func nextafter(x: Num, y: Num -> Num)
-```
-
-- `x`: The starting number.
-- `y`: The direction towards which to find the next representable value.
-
-**Returns:**
-The next representable value after `x` in the direction of `y`.
-
-**Example:**
-```tomo
->> (1.0).nextafter(1.1)
-= 1.0000000000000002
-```
-
----
-
-### `parse`
-Converts a text representation of a number into a floating-point number.
-
-```tomo
-func parse(text: Text -> Num?)
-```
-
-- `text`: The text containing the number.
-
-**Returns:**
-The number represented by the text or `none` if the entire text can't be parsed
-as a number.
-
-**Example:**
-```tomo
->> Num.parse("3.14")
-= 3.14
->> Num.parse("1e3")
-= 1000
-```
-
----
-
-### `percent`
-Convert a number into a percentage text with a percent sign.
-
-```tomo
-func percent(n: Num, precision: Int = 0 -> Text)
-```
-
-- `n`: The number to be converted to a percent.
-- `precision`: The number of decimal places. Default is `0`.
-
-**Returns:**
-A text representation of the number as a percentage with a percent sign.
-
-**Example:**
-```tomo
->> (0.5).percent()
-= "50%"
->> (1./3.).percent(2)
-= "33.33%"
-```
-
----
-
-### `rint`
-Rounds a number to the nearest integer, with ties rounded to the nearest even integer.
-
-```tomo
-func rint(x: Num -> Num)
-```
-
-- `x`: The number to be rounded.
-
-**Returns:**
-The nearest integer value of `x`.
-
-**Example:**
-```tomo
->> (3.5).rint()
-= 4
->> (2.5).rint()
-= 2
-```
-
----
-
-### `round`
-Rounds a number to the nearest whole number integer.
-
-```tomo
-func round(x: Num -> Num)
-```
-
-- `x`: The number to be rounded.
-
-**Returns:**
-The nearest integer value of `x`.
-
-**Example:**
-```tomo
->> (2.3).round()
-= 2
->> (2.7).round()
-= 3
-```
-
----
-
-### `scientific`
-Formats a number in scientific notation with a specified precision.
-
-```tomo
-func scientific(n: Num, precision: Int = 0 -> Text)
-```
-
-- `n`: The number to be formatted.
-- `precision`: The number of decimal places. Default is `0`.
-
-**Returns:**
-A text representation of the number in scientific notation with the specified precision.
-
-**Example:**
-```tomo
->> (12345.6789).scientific(precision=2)
-= "1.23e+04"
-```
-
----
-
-### `significand`
-Extracts the significand (or mantissa) of a number.
-
-```tomo
-func significand(x: Num -> Num)
-```
-
-- `x`: The number from which to extract the significand.
-
-**Returns:**
-The significand of `x`.
-
-**Example:**
-```tomo
->> (1234.567).significand()
-= 0.1234567
-```
-
----
-
-### `sin`
-Computes the sine of a number (angle in radians).
-
-```tomo
-func sin(x: Num -> Num)
-```
-
-- `x`: The angle in radians.
-
-**Returns:**
-The sine of `x`.
-
-**Example:**
-```tomo
->> (0.0).sin()
-= 0
-```
-
----
-
-### `sinh`
-Computes the hyperbolic sine of a number.
-
-```tomo
-func sinh(x: Num -> Num)
-```
-
-- `x`: The number for which the hyperbolic sine is to be calculated.
-
-**Returns:**
-The hyperbolic sine of `x`.
-
-**Example:**
-```tomo
->> (0.0).sinh()
-= 0
-```
-
----
-
-### `sqrt`
-Computes the square root of a number.
-
-```tomo
-func sqrt(x: Num -> Num)
-```
-
-- `x`: The number for which the square root is to be calculated.
-
-**Returns:**
-The square root of `x`.
-
-**Example:**
-```tomo
->> (16.0).sqrt()
-= 4
-```
-
----
-
-### `tan`
-Computes the tangent of a number (angle in radians).
-
-```tomo
-func tan(x: Num -> Num)
-```
-
-- `x`: The angle in radians.
-
-**Returns:**
-The tangent of `x`.
-
-**Example:**
-```tomo
->> (0.0).tan()
-= 0
-```
-
----
-
-### `tanh`
-Computes the hyperbolic tangent of a number.
-
-```tomo
-func tanh(x: Num -> Num)
-```
-
-- `x`: The number for which the hyperbolic tangent is to be calculated.
-
-**Returns:**
-The hyperbolic tangent of `x`.
-
-**Example:**
-```tomo
->> (0.0).tanh()
-= 0
-```
-
----
-
-### `tgamma`
-Computes the gamma function of a number.
-
-```tomo
-func tgamma(x: Num -> Num)
-```
-
-- `x`: The number for which the gamma function is to be calculated.
-
-**Returns:**
-The gamma function of `x`.
-
-**Example:**
-```tomo
->> (1.0).tgamma()
-= 1
-```
-
----
-
-### `trunc`
-Truncates a number to the nearest integer towards zero.
-
-```tomo
-func trunc(x: Num -> Num)
-```
-
-- `x`: The number to be truncated.
-
-**Returns:**
-The integer part of `x` towards zero.
-
-**Example:**
-```tomo
->> (3.7).trunc()
-= 3
->> (-3.7).trunc()
-= -3
-```
-
----
-
-### `y0`
-Computes the Bessel function of the second kind of order 0.
-
-```tomo
-func y0(x: Num -> Num)
-```
-
-- `x`: The number for which the Bessel function is to be calculated.
-
-**Returns:**
-The Bessel function of the second kind of order 0 of `x`.
-
-**Example:**
-```tomo
->> (1.0).y0()
-= -0.7652
-```
-
----
-
-### `y1`
-Computes the Bessel function of the second kind of order 1.
-
-```tomo
-func y1(x: Num -> Num)
-```
-
-- `x`: The number for which the Bessel function is to be calculated.
-
-**Returns:**
-The Bessel function of the second kind of order 1 of `x`.
-
-**Example:**
-```tomo
->> (1.0).y1()
-= 0.4401
-```
+[API documentation](../api/nums.md)
diff --git a/docs/paths.md b/docs/paths.md
index 6cf986a7..2fa55b13 100644
--- a/docs/paths.md
+++ b/docs/paths.md
@@ -35,967 +35,6 @@ i.e. the name of a directory or file. If a user were to supply a value like
intended. Paths can be created from text with slashes using
`Path.from_text(text)` if you need to use arbitrary text as a file path.
-## Path Methods
+# API
-- [`func accessed(path:Path, follow_symlinks=yes -> Int64?)`](#accessed)
-- [`func append(path: Path, text: Text, permissions: Int32 = 0o644[32] -> Void)`](#append)
-- [`func append_bytes(path: Path, bytes: [Byte], permissions: Int32 = 0o644[32] -> Void)`](#append_bytes)
-- [`func base_name(path: Path -> Text)`](#base_name)
-- [`func by_line(path: Path -> func(->Text?)?)`](#by_line)
-- [`func can_execute(path:Path -> Bool)`](#can_execute)
-- [`func can_read(path:Path -> Bool)`](#can_read)
-- [`func can_write(path:Path -> Bool)`](#can_write)
-- [`func changed(path:Path, follow_symlinks=yes -> Int64?)`](#changed)
-- [`func child(path: Path, child:Text -> Path)`](#child)
-- [`func children(path: Path, include_hidden=no -> [Path])`](#children)
-- [`func create_directory(path: Path, permissions=0o755[32] -> Void)`](#create_directory)
-- [`func current_dir(-> Path)`](#current_dir)
-- [`func exists(path: Path -> Bool)`](#exists)
-- [`func expand_home(path: Path -> Path)`](#expand_home)
-- [`func extension(path: Path, full=yes -> Text)`](#extension)
-- [`func files(path: Path, include_hidden=no -> [Path])`](#files)
-- [`func from_components(components:[Text] -> Path)`](#from_components)
-- [`func glob(path: Path -> [Path])`](#glob)
-- [`func group(path: Path, follow_symlinks=yes -> Text?)`](#group)
-- [`func is_directory(path: Path, follow_symlinks=yes -> Bool)`](#is_directory)
-- [`func is_file(path: Path, follow_symlinks=yes -> Bool)`](#is_file)
-- [`func is_socket(path: Path, follow_symlinks=yes -> Bool)`](#is_socket)
-- [`func is_symlink(path: Path -> Bool)`](#is_symlink)
-- [`func modified(path:Path, follow_symlinks=yes -> Int64?)`](#modified)
-- [`func owner(path: Path, follow_symlinks=yes -> Text?)`](#owner)
-- [`func parent(path: Path -> Path)`](#parent)
-- [`func read(path: Path -> Text?)`](#read)
-- [`func read_bytes(path: Path, limit: Int? = none -> [Byte]?)`](#read_bytes)
-- [`func relative_to(path: Path, relative_to=(./) -> Path)`](#relative_to)
-- [`func remove(path: Path, ignore_missing=no -> Void)`](#remove)
-- [`func resolved(path: Path, relative_to=(./) -> Path)`](#resolved)
-- [`func set_owner(path:Path, owner:Text?=none, group:Text?=none, follow_symlinks=yes)`](#set_owner)
-- [`func subdirectories(path: Path, include_hidden=no -> [Path])`](#subdirectories)
-- [`func unique_directory(path: Path -> Path)`](#unique_directory)
-- [`func write(path: Path, text: Text, permissions=0o644[32] -> Void)`](#write)
-- [`func write_bytes(path: Path, bytes: [Byte], permissions=0o644[32] -> Void)`](#write_bytes)
-- [`func write_unique(path: Path, text: Text -> Path)`](#write_unique)
-- [`func write_unique_bytes(path: Path, bytes: [Byte] -> Path)`](#write_unique_bytes)
-
-### `accessed`
-Gets the file access time of a file.
-
-```tomo
-func accessed(path:Path, follow_symlinks: Bool = yes -> Int64?)
-```
-
-- `path`: The path of the file whose access time you want.
-- `follow_symlinks`: Whether to follow symbolic links (default is `yes`).
-
-**Returns:**
-A 64-bit unix epoch timestamp representing when the file or directory was last
-accessed, or `none` if no such file or directory exists.
-
-**Example:**
-```tomo
->> (./file.txt).accessed()
-= 1704221100?
->> (./not-a-file).accessed()
-= none
-```
-
----
-
-### `append`
-Appends the given text to the file at the specified path, creating the file if
-it doesn't already exist. Failure to write will result in a runtime error.
-
-```tomo
-func append(path: Path, text: Text, permissions: Int32 = 0o644[32] -> Void)
-```
-
-- `path`: The path of the file to append to.
-- `text`: The text to append to the file.
-- `permissions`: The permissions to set on the file if it is being created (default is `0o644`).
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-(./log.txt).append("extra line$(\n)")
-```
-
----
-
-### `append_bytes`
-Appends the given bytes to the file at the specified path, creating the file if
-it doesn't already exist. Failure to write will result in a runtime error.
-
-```tomo
-func append_bytes(path: Path, bytes: [Byte], permissions: Int32 = 0o644[32] -> Void)
-```
-
-- `path`: The path of the file to append to.
-- `bytes`: The bytes to append to the file.
-- `permissions`: The permissions to set on the file if it is being created (default is `0o644`).
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-(./log.txt).append_bytes([104[B], 105[B]])
-```
-
----
-
-### `base_name`
-Returns the base name of the file or directory at the specified path.
-
-```tomo
-func base_name(path: Path -> Text)
-```
-
-- `path`: The path of the file or directory.
-
-**Returns:**
-The base name of the file or directory.
-
-**Example:**
-```tomo
->> (./path/to/file.txt).base_name()
-= "file.txt"
-```
-
----
-
-### `by_line`
-Returns an iterator that can be used to iterate over a file one line at a time,
-or returns a null value if the file could not be opened.
-
-```tomo
-func by_line(path: Path -> func(->Text?)?)
-```
-
-- `path`: The path of the file.
-
-**Returns:**
-An iterator that can be used to get lines from a file one at a time or a null
-value if the file couldn't be read.
-
-**Example:**
-```tomo
-# Safely handle file not being readable:
-if lines := (./file.txt).by_line()
- for line in lines
- say(line.upper())
-else
- say("Couldn't read file!")
-
-# Assume the file is readable and error if that's not the case:
-for line in (/dev/stdin).by_line()!
- say(line.upper())
-```
-
----
-
-### `can_execute`
-Returns whether or not a file can be executed by the current user/group.
-
-```tomo
-func can_execute(path: Path -> Bool)
-```
-
-- `path`: The path of the file to check.
-
-**Returns:**
-`yes` if the file or directory exists and the current user has execute permissions, otherwise `no`.
-
-**Example:**
-```tomo
->> (/bin/sh).can_execute()
-= yes
->> (/usr/include/stdlib.h).can_execute()
-= no
->> (/non/existant/file).can_execute()
-= no
-```
-
----
-
-### `can_read`
-Returns whether or not a file can be read by the current user/group.
-
-```tomo
-func can_read(path: Path -> Bool)
-```
-
-- `path`: The path of the file to check.
-
-**Returns:**
-`yes` if the file or directory exists and the current user has read permissions, otherwise `no`.
-
-**Example:**
-```tomo
->> (/usr/include/stdlib.h).can_read()
-= yes
->> (/etc/shadow).can_read()
-= no
->> (/non/existant/file).can_read()
-= no
-```
-
----
-
-### `can_write`
-Returns whether or not a file can be written by the current user/group.
-
-```tomo
-func can_write(path: Path -> Bool)
-```
-
-- `path`: The path of the file to check.
-
-**Returns:**
-`yes` if the file or directory exists and the current user has write permissions, otherwise `no`.
-
-**Example:**
-```tomo
->> (/tmp).can_write()
-= yes
->> (/etc/passwd).can_write()
-= no
->> (/non/existant/file).can_write()
-= no
-```
-
----
-
-### `changed`
-Gets the file change time of a file.
-
-**Note:** this is the
-["ctime"](https://en.wikipedia.org/wiki/Stat_(system_call)#ctime) of a file,
-which is _not_ the file creation time.
-
-```tomo
-func changed(path:Path, follow_symlinks: Bool = yes -> Int64?)
-```
-
-- `path`: The path of the file whose change time you want.
-- `follow_symlinks`: Whether to follow symbolic links (default is `yes`).
-
-**Returns:**
-A 64-bit unix epoch timestamp representing when the file or directory was last
-changed, or `none` if no such file or directory exists.
-
-**Example:**
-```tomo
->> (./file.txt).changed()
-= 1704221100?
->> (./not-a-file).changed()
-= none
-```
-
----
-
-### `child`
-Return a path that is a child of another path.
-
-```tomo
-func child(path: Path, child: Text -> [Path])
-```
-
-- `path`: The path of a directory.
-- `child`: The name of a child file or directory.
-
-**Returns:**
-A new path representing the child.
-
-**Example:**
-```tomo
->> (./directory).child("file.txt")
-= (./directory/file.txt)
-```
-
----
-
-### `children`
-Returns a list of children (files and directories) within the directory at the specified path. Optionally includes hidden files.
-
-```tomo
-func children(path: Path, include_hidden=no -> [Path])
-```
-
-- `path`: The path of the directory.
-- `include_hidden`: Whether to include hidden files, which start with a `.` (default is `no`).
-
-**Returns:**
-A list of paths for the children.
-
-**Example:**
-```tomo
->> (./directory).children(include_hidden=yes)
-= [".git", "foo.txt"]
-```
-
----
-
-### `create_directory`
-Creates a new directory at the specified path with the given permissions. If
-any of the parent directories do not exist, they will be created as needed.
-
-```tomo
-func create_directory(path: Path, permissions=0o755[32] -> Void)
-```
-
-- `path`: The path of the directory to create.
-- `permissions`: The permissions to set on the new directory (default is `0o644`).
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-(./new_directory).create_directory()
-```
-
----
-
-### `current_dir`
-Creates a new directory at the specified path with the given permissions. If
-any of the parent directories do not exist, they will be created as needed.
-
-```tomo
-func current_dir(-> Path)
-```
-
-**Returns:**
-The absolute path of the current directory.
-
-**Example:**
-```tomo
->> Path.current_dir()
-= (/home/user/tomo)
-```
-
----
-
-### `exists`
-Checks if a file or directory exists at the specified path.
-
-```tomo
-func exists(path: Path -> Bool)
-```
-
-- `path`: The path to check.
-
-**Returns:**
-`True` if the file or directory exists, `False` otherwise.
-
-**Example:**
-```tomo
->> (/).exists()
-= yes
-```
-
----
-
-### `expand_home`
-For home-based paths (those starting with `~`), expand the path to replace the
-tilde with and absolute path to the user's `$HOME` directory.
-
-```tomo
-func expand_home(path: Path -> Path)
-```
-
-- `path`: The path to expand.
-
-**Returns:**
-If the path does not start with a `~`, then return it unmodified. Otherwise,
-replace the `~` with an absolute path to the user's home directory.
-
-**Example:**
-```tomo
->> (~/foo).expand_home() # Assume current user is 'user'
-= /home/user/foo
->> (/foo).expand_home() # No change
-= /foo
-```
-
----
-
-### `extension`
-Returns the file extension of the file at the specified path. Optionally returns the full extension.
-
-```tomo
-func extension(path: Path, full:Bool = yes -> Text)
-```
-
-- `path`: The path of the file.
-- `full`: Whether to return everything after the first `.` in the
- base name, or only the last part of the extension (default is `yes`).
-
-**Returns:**
-The file extension (not including the leading `.`) or an empty text if there is
-no file extension.
-
-**Example:**
-```tomo
->> (./file.tar.gz).extension()
-= "tar.gz"
->> (./file.tar.gz).extension(full=no)
-= "gz"
->> (/foo).extension()
-= ""
->> (./.git).extension()
-= ""
-```
-
----
-
-### `files`
-Returns a list of files within the directory at the specified path. Optionally includes hidden files.
-
-```tomo
-func files(path: Path, include_hidden: Bool = no -> [Path])
-```
-
-- `path`: The path of the directory.
-- `include_hidden`: Whether to include hidden files (default is `no`).
-
-**Returns:**
-A list of file paths.
-
-**Example:**
-```tomo
->> (./directory).files(include_hidden=yes)
-= [(./directory/file1.txt), (./directory/file2.txt)]
-```
-
----
-
-### `from_components`
-Returns a path built from a list of path components.
-
-```tomo
-func from_components(components: [Text] -> Path)
-```
-
-- `components`: A list of path components.
-
-**Returns:**
-A path representing the given components.
-
-**Example:**
-```tomo
->> Path.from_components(["/", "usr", "include"])
-= /usr/include
->> Path.from_components(["foo.txt"])
-= ./foo.txt
->> Path.from_components(["~", ".local"])
-= ~/.local
-```
-
----
-
-### `glob`
-Perform a globbing operation and return a list of matching paths. Some glob
-specific details:
-
-- The paths "." and ".." are *not* included in any globbing results.
-- Files or directories that begin with "." will not match `*`, but will match `.*`.
-- Globs do support `{a,b}` syntax for matching files that match any of several
- choices of patterns.
-- The shell-style syntax `**` for matching subdirectories is not supported.
-
-```tomo
-func glob(path: Path -> [Path])
-```
-
-- `path`: The path of the directory which may contain special globbing characters
- like `*`, `?`, or `{...}`
-
-**Returns:**
-A list of file paths that match the glob.
-
-**Example:**
-```tomo
-# Current directory includes: foo.txt, baz.txt, qux.jpg, .hidden
->> (./*).glob()
-= [(./foo.txt), (./baz.txt), (./qux.jpg)]
-
->> (./*.txt).glob()
-= [(./foo.txt), (./baz.txt)]
-
->> (./*.{txt,jpg}).glob()
-= [(./foo.txt), (./baz.txt), (./qux.jpg)]
-
->> (./.*).glob()
-= [(./.hidden)]
-
-# Globs with no matches return an empty list:
->> (./*.xxx).glob()
-= []
-```
-
----
-
-### `group`
-Get the owning group of a file or directory.
-
-```tomo
-func group(path: Path, follow_symlinks: Bool = yes -> Text?)
-```
-
-- `path`: The path whose owning group to get.
-- `follow_symlinks`: Whether to follow symbolic links (default is `yes`).
-
-**Returns:**
-The name of the group which owns the file or directory, or `none` if the path does not exist.
-
-**Example:**
-```tomo
->> (/bin).group()
-= "root"
->> (/non/existent/file).group()
-= none
-```
-
----
-
-### `is_directory`
-Checks if the path represents a directory. Optionally follows symbolic links.
-
-```tomo
-func is_directory(path: Path, follow_symlinks=yes -> Bool)
-```
-
-- `path`: The path to check.
-- `follow_symlinks`: Whether to follow symbolic links (default is `yes`).
-
-**Returns:**
-`True` if the path is a directory, `False` otherwise.
-
-**Example:**
-```tomo
->> (./directory/).is_directory()
-= yes
-
->> (./file.txt).is_directory()
-= no
-```
-
----
-
-### `is_file`
-Checks if the path represents a file. Optionally follows symbolic links.
-
-```tomo
-func is_file(path: Path, follow_symlinks=yes -> Bool)
-```
-
-- `path`: The path to check.
-- `follow_symlinks`: Whether to follow symbolic links (default is `yes`).
-
-**Returns:**
-`True` if the path is a file, `False` otherwise.
-
-**Example:**
-```tomo
->> (./file.txt).is_file()
-= yes
-
->> (./directory/).is_file()
-= no
-```
-
----
-
-### `is_socket`
-Checks if the path represents a socket. Optionally follows symbolic links.
-
-```tomo
-func is_socket(path: Path, follow_symlinks=yes -> Bool)
-```
-
-- `path`: The path to check.
-- `follow_symlinks`: Whether to follow symbolic links (default is `yes`).
-
-**Returns:**
-`True` if the path is a socket, `False` otherwise.
-
-**Example:**
-```tomo
->> (./socket).is_socket()
-= yes
-```
-
----
-
-### `is_symlink`
-Checks if the path represents a symbolic link.
-
-```tomo
-func is_symlink(path: Path -> Bool)
-```
-
-- `path`: The path to check.
-
-**Returns:**
-`True` if the path is a symbolic link, `False` otherwise.
-
-**Example:**
-```tomo
->> (./link).is_symlink()
-= yes
-```
-
----
-
-### `modified`
-Gets the file modification time of a file.
-
-```tomo
-func modified(path:Path, follow_symlinks: Bool = yes -> Int64?)
-```
-
-- `path`: The path of the file whose modification time you want.
-- `follow_symlinks`: Whether to follow symbolic links (default is `yes`).
-
-**Returns:**
-A 64-bit unix epoch timestamp representing when the file or directory was last
-modified, or `none` if no such file or directory exists.
-
-**Example:**
-```tomo
->> (./file.txt).modified()
-= 1704221100?
->> (./not-a-file).modified()
-= none
-```
-
----
-
-### `owner`
-Get the owning user of a file or directory.
-
-```tomo
-func owner(path: Path, follow_symlinks: Bool = yes -> Text?)
-```
-
-- `path`: The path whose owner to get.
-- `follow_symlinks`: Whether to follow symbolic links (default is `yes`).
-
-**Returns:**
-The name of the user who owns the file or directory, or `none` if the path does not exist.
-
-**Example:**
-```tomo
->> (/bin).owner()
-= "root"
->> (/non/existent/file).owner()
-= none
-```
-
----
-
-### `parent`
-Returns the parent directory of the file or directory at the specified path.
-
-```tomo
-func parent(path: Path -> Path)
-```
-
-- `path`: The path of the file or directory.
-
-**Returns:**
-The path of the parent directory.
-
-**Example:**
-```tomo
->> (./path/to/file.txt).parent()
-= (./path/to/)
-```
-
----
-
-### `read`
-Reads the contents of the file at the specified path or a null value if the
-file could not be read.
-
-```tomo
-func read(path: Path -> Text?)
-```
-
-- `path`: The path of the file to read.
-
-**Returns:**
-The contents of the file. If the file could not be read, a null value will be
-returned. If the file can be read, but is not valid UTF8 data, an error will be
-raised.
-
-**Example:**
-```tomo
->> (./hello.txt).read()
-= "Hello"?
-
->> (./nosuchfile.xxx).read()
-= none
-```
----
-
-### `read_bytes`
-Reads the contents of the file at the specified path or a null value if the
-file could not be read.
-
-```tomo
-func read_bytes(path: Path, limit: Int? = none -> [Byte]?)
-```
-
-- `path`: The path of the file to read.
-- `limit`: A limit to how many bytes should be read.
-
-**Returns:**
-The byte contents of the file. If the file cannot be read, a null value will be
-returned.
-
-**Example:**
-```tomo
->> (./hello.txt).read()
-= [72[B], 101[B], 108[B], 108[B], 111[B]]?
-
->> (./nosuchfile.xxx).read()
-= none
-```
-
----
-
-### `relative_to`
-Returns the path relative to a given base path. By default, the base path is the current directory.
-
-```tomo
-func relative_to(path: Path, relative_to=(./) -> Path)
-```
-
-- `path`: The path to convert.
-- `relative_to`: The base path for the relative path (default is `./`).
-
-**Returns:**
-The relative path.
-
-**Example:**
-```tomo
->> (./path/to/file.txt).relative(relative_to=(./path))
-= (./to/file.txt)
-```
-
----
-
-### `remove`
-Removes the file or directory at the specified path. A runtime error is raised if something goes wrong.
-
-```tomo
-func remove(path: Path, ignore_missing=no -> Void)
-```
-
-- `path`: The path to remove.
-- `ignore_missing`: Whether to ignore errors if the file or directory does not exist (default is `no`).
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-(./file.txt).remove()
-```
-
----
-
-### `resolved`
-Resolves the absolute path of the given path relative to a base path. By default, the base path is the current directory.
-
-```tomo
-func resolved(path: Path, relative_to=(./) -> Path)
-```
-
-- `path`: The path to resolve.
-- `relative_to`: The base path for resolution (default is `./`).
-
-**Returns:**
-The resolved absolute path.
-
-**Example:**
-```tomo
->> (~/foo).resolved()
-= (/home/user/foo)
-
->> (./path/to/file.txt).resolved(relative_to=(/foo))
-= (/foo/path/to/file.txt)
-```
-
----
-
-### `set_owner`
-Set the owning user and/or group for a path.
-
-```tomo
-func set_owner(path:Path, owner: Text? = none, group: Text? = none, follow_symlinks: Bool = yes)
-```
-
-- `path`: The path to change the permissions for.
-- `owner`: If non-none, the new user to assign to be the owner of the file (default: `none`).
-- `group`: If non-none, the new group to assign to be the owner of the file (default: `none`).
-- `follow_symlinks`: Whether to follow symbolic links (default is `yes`).
-
-**Returns:**
-Nothing. If a path does not exist, a failure will be raised.
-
-**Example:**
-```tomo
-(./file.txt).set_owner(owner="root", group="wheel")
-```
-
----
-
-### `subdirectories`
-Returns a list of subdirectories within the directory at the specified path. Optionally includes hidden subdirectories.
-
-```tomo
-func subdirectories(path: Path, include_hidden=no -> [Path])
-```
-
-- `path`: The path of the directory.
-- `include_hidden`: Whether to include hidden subdirectories (default is `no`).
-
-**Returns:**
-A list of subdirectory paths.
-
-**Example:**
-```tomo
->> (./directory).subdirectories()
-= [(./directory/subdir1), (./directory/subdir2)]
-
->> (./directory).subdirectories(include_hidden=yes)
-= [(./directory/.git), (./directory/subdir1), (./directory/subdir2)]
-```
-
----
-
-### `unique_directory`
-Generates a unique directory path based on the given path. Useful for creating temporary directories.
-
-```tomo
-func unique_directory(path: Path -> Path)
-```
-
-- `path`: The base path for generating the unique directory. The last six letters of this path must be `XXXXXX`.
-
-**Returns:**
-A unique directory path after creating the directory.
-
-**Example:**
-
-```
->> created := (/tmp/my-dir.XXXXXX).unique_directory()
-= (/tmp/my-dir-AwoxbM/)
->> created.is_directory()
-= yes
-created.remove()
-```
-
----
-
-### `write`
-Writes the given text to the file at the specified path, creating the file if
-it doesn't already exist. Sets the file permissions as specified. If the file
-writing cannot be successfully completed, a runtime error is raised.
-
-```tomo
-func write(path: Path, text: Text, permissions=0o644[32] -> Void)
-```
-
-- `path`: The path of the file to write to.
-- `text`: The text to write to the file.
-- `permissions`: The permissions to set on the file if it is created (default is `0o644`).
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-(./file.txt).write("Hello, world!")
-```
-
----
-
-### `write_bytes`
-Writes the given bytes to the file at the specified path, creating the file if
-it doesn't already exist. Sets the file permissions as specified. If the file
-writing cannot be successfully completed, a runtime error is raised.
-
-```tomo
-func write(path: Path, bytes: [Byte], permissions=0o644[32] -> Void)
-```
-
-- `path`: The path of the file to write to.
-- `bytes`: A list of bytes to write to the file.
-- `permissions`: The permissions to set on the file if it is created (default is `0o644`).
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-(./file.txt).write_bytes([104[B], 105[B]])
-```
-
----
-
-### `write_unique`
-Writes the given text to a unique file path based on the specified path. The
-file is created if it doesn't exist. This is useful for creating temporary
-files.
-
-```tomo
-func write_unique(path: Path, text: Text -> Path)
-```
-
-- `path`: The base path for generating the unique file. This path must include
- the string `XXXXXX` in the file base name.
-- `text`: The text to write to the file.
-
-**Returns:**
-The path of the newly created unique file.
-
-**Example:**
-```tomo
->> created := (./file-XXXXXX.txt).write_unique("Hello, world!")
-= (./file-27QHtq.txt)
->> created.read()
-= "Hello, world!"
-created.remove()
-```
-
----
-
-### `write_unique_bytes`
-Writes the given bytes to a unique file path based on the specified path. The
-file is created if it doesn't exist. This is useful for creating temporary
-files.
-
-```tomo
-func write_unique_bytes(path: Path, bytes: [Byte] -> Path)
-```
-
-- `path`: The base path for generating the unique file. This path must include
- the string `XXXXXX` in the file base name.
-- `bytes`: The bytes to write to the file.
-
-**Returns:**
-The path of the newly created unique file.
-
-**Example:**
-```tomo
->> created := (./file-XXXXXX.txt).write_unique_bytes([1[B], 2[B], 3[B]])
-= (./file-27QHtq.txt)
->> created.read()
-= [1[B], 2[B], 3[B]]
-created.remove()
-```
+[API documentation](../api/paths.md)
diff --git a/docs/sets.md b/docs/sets.md
index d40b825c..c8d67fc4 100644
--- a/docs/sets.md
+++ b/docs/sets.md
@@ -73,238 +73,6 @@ Set iteration operates over the value of the set when the loop began, so
modifying the set during iteration is safe and will not result in the loop
iterating over any of the new values.
-## Set Methods
+# API
-- [`func add(set:|T|, item: T -> Void)`](#add)
-- [`func add_all(set:@|T|, items: [T] -> Void)`](#add_all)
-- [`func clear(set:@|T| -> Void)`](#clear)
-- [`func has(set:|T|, item:T -> Bool)`](#has)
-- [`func (set: |T|, other: |T|, strict: Bool = no -> Bool)`](#is_subset_of)
-- [`func is_superset_of(set:|T|, other: |T|, strict: Bool = no -> Bool)`](#is_superset_of)
-- [`func overlap(set:|T|, other: |T| -> |T|)`](#overlap)
-- [`func remove(set:@|T|, item: T -> Void)`](#remove)
-- [`func remove_all(set:@|T|, items: [T] -> Void)`](#remove_all)
-- [`func with(set:|T|, other: |T| -> |T|)`](#with)
-- [`func without(set:|T|, other: |T| -> |T|)`](#without)
-
-### `add`
-Adds an item to the set.
-
-```tomo
-func add(set:|T|, item: T -> Void)
-```
-
-- `set`: The mutable reference to the set.
-- `item`: The item to add to the set.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> nums.add(42)
-```
-
----
-
-### `add_all`
-Adds multiple items to the set.
-
-```tomo
-func add_all(set:@|T|, items: [T] -> Void)
-```
-
-- `set`: The mutable reference to the set.
-- `items`: The list of items to add to the set.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> nums.add_all([1, 2, 3])
-```
-
----
-
-### `clear`
-Removes all items from the set.
-
-```tomo
-func clear(set:@|T| -> Void)
-```
-
-- `set`: The mutable reference to the set.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> nums.clear()
-```
-
----
-
-### `has`
-Checks if the set contains a specified item.
-
-```tomo
-func has(set:|T|, item:T -> Bool)
-```
-
-- `set`: The set to check.
-- `item`: The item to check for presence.
-
-**Returns:**
-`yes` if the item is present, `no` otherwise.
-
-**Example:**
-```tomo
->> |10, 20|.has(20)
-= yes
-```
-
----
-
-### `is_subset_of`
-Checks if the set is a subset of another set.
-
-```tomo
-func (set: |T|, other: |T|, strict: Bool = no -> Bool)
-```
-
-- `set`: The set to check.
-- `other`: The set to compare against.
-- `strict`: If `yes`, checks if the set is a strict subset (does not equal the other set).
-
-**Returns:**
-`yes` if the set is a subset of the other set (strictly or not), `no` otherwise.
-
-**Example:**
-```tomo
->> |1, 2|.is_subset_of(|1, 2, 3|)
-= yes
-```
-
----
-
-### `is_superset_of`
-Checks if the set is a superset of another set.
-
-```tomo
-func is_superset_of(set:|T|, other: |T|, strict: Bool = no -> Bool)
-```
-
-- `set`: The set to check.
-- `other`: The set to compare against.
-- `strict`: If `yes`, checks if the set is a strict superset (does not equal the other set).
-
-**Returns:**
-`yes` if the set is a superset of the other set (strictly or not), `no` otherwise.
-
-**Example:**
-```tomo
->> |1, 2, 3|.is_superset_of(|1, 2|)
-= yes
-```
-### `overlap`
-Creates a new set with items that are in both the original set and another set.
-
-```tomo
-func overlap(set:|T|, other: |T| -> |T|)
-```
-
-- `set`: The original set.
-- `other`: The set to intersect with.
-
-**Returns:**
-A new set containing only items present in both sets.
-
-**Example:**
-```tomo
->> |1, 2|.overlap(|2, 3|)
-= |2|
-```
-
----
-
-### `remove`
-Removes an item from the set.
-
-```tomo
-func remove(set:@|T|, item: T -> Void)
-```
-
-- `set`: The mutable reference to the set.
-- `item`: The item to remove from the set.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> nums.remove(42)
-```
-
----
-
-### `remove_all`
-Removes multiple items from the set.
-
-```tomo
-func remove_all(set:@|T|, items: [T] -> Void)
-```
-
-- `set`: The mutable reference to the set.
-- `items`: The list of items to remove from the set.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> nums.remove_all([1, 2, 3])
-```
-
----
-
-### `with`
-Creates a new set that is the union of the original set and another set.
-
-```tomo
-func with(set:|T|, other: |T| -> |T|)
-```
-
-- `set`: The original set.
-- `other`: The set to union with.
-
-**Returns:**
-A new set containing all items from both sets.
-
-**Example:**
-```tomo
->> |1, 2|.with(|2, 3|)
-= |1, 2, 3|
-```
-
----
-
-### `without`
-Creates a new set with items from the original set but without items from another set.
-
-```tomo
-func without(set:|T|, other: |T| -> |T|)
-```
-
-- `set`: The original set.
-- `other`: The set of items to remove from the original set.
-
-**Returns:**
-A new set containing items from the original set excluding those in the other set.
-
-**Example:**
-```tomo
->> |1, 2|.without(|2, 3|)
-= |1|
-```
+[API documentation](../api/sets.md)
diff --git a/docs/tables.md b/docs/tables.md
index d83a678b..2f07436a 100644
--- a/docs/tables.md
+++ b/docs/tables.md
@@ -150,169 +150,6 @@ Table iteration operates over the value of the table when the loop began, so
modifying the table during iteration is safe and will not result in the loop
iterating over any of the new values.
-## Table Methods
+# API
-- [`func clear(t:&{K=V})`](#clear)
-- [`func get(t:{K=V}, key: K -> V?)`](#get)
-- [`func get_or_set(t:&{K=V}, key: K, default: V -> V)`](#get_or_set)
-- [`func has(t:{K=V}, key: K -> Bool)`](#has)
-- [`func remove(t:{K=V}, key: K -> Void)`](#remove)
-- [`func set(t:{K=V}, key: K, value: V -> Void)`](#set)
-
----
-
-### `clear`
-Removes all key-value pairs from the table.
-
-```tomo
-func clear(t:&{K=V})
-```
-
-- `t`: The reference to the table.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
->> t.clear()
-```
-
----
-
-### `get`
-Retrieves the value associated with a key, or returns `none` if the key is not present.
-**Note:** default values for the table are ignored.
-
-```tomo
-func get(t:{K=V}, key: K -> V?)
-```
-
-- `t`: The table.
-- `key`: The key whose associated value is to be retrieved.
-
-**Returns:**
-The value associated with the key or `none` if the key is not found.
-
-**Example:**
-```tomo
->> t := {"A"=1, "B"=2}
->> t.get("A")
-= 1?
-
->> t.get("????")
-= none
-
->> t.get("A")!
-= 1
-
->> t.get("????") or 0
-= 0
-```
-
----
-
-### `get_or_set`
-If the given key is in the table, return the associated value. Otherwise,
-insert the given default value into the table and return it.
-
-**Note:** If no default value is provided explicitly, but the table has a
-default value associated with it, the table's default value will be used.
-
-**Note:** The default value is only evaluated if the key is missing.
-
-```tomo
-func get_or_set(t: &{K=V}, key: K, default: V -> V?)
-```
-
-- `t`: The table.
-- `key`: The key whose associated value is to be retrieved.
-- `default`: The default value to insert and return if the key is not present in the table.
-
-**Returns:**
-Either the value associated with the key (if present) or the default value. The
-table will be mutated if the key is not already present.
-
-**Example:**
-```tomo
->> t := &{"A"=@[1, 2, 3]; default=@[]}
->> t.get_or_set("A").insert(4)
->> t.get_or_set("B").insert(99)
->> t
-= &{"A"=@[1, 2, 3, 4], "B"=@[99]}
-
->> t.get_or_set("C", @[0, 0, 0])
-= @[0, 0, 0]
->> t
-= &{"A"=@[1, 2, 3, 4], "B"=@[99], "C"=@[0, 0, 0]}
-```
-
----
-
-### `has`
-Checks if the table contains a specified key.
-
-```tomo
-func has(t:{K=V}, key: K -> Bool)
-```
-
-- `t`: The table.
-- `key`: The key to check for presence.
-
-**Returns:**
-`yes` if the key is present, `no` otherwise.
-
-**Example:**
-```tomo
->> {"A"=1, "B"=2}.has("A")
-= yes
->> {"A"=1, "B"=2}.has("xxx")
-= no
-```
-
----
-
-### `remove`
-Removes the key-value pair associated with a specified key.
-
-```tomo
-func remove(t:{K=V}, key: K -> Void)
-```
-
-- `t`: The reference to the table.
-- `key`: The key of the key-value pair to remove.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-t := {"A"=1, "B"=2}
-t.remove("A")
->> t
-= {"B"=2}
-```
-
----
-
-### `set`
-Sets or updates the value associated with a specified key.
-
-```tomo
-func set(t:{K=V}, key: K, value: V -> Void)
-```
-
-- `t`: The reference to the table.
-- `key`: The key to set or update.
-- `value`: The value to associate with the key.
-
-**Returns:**
-Nothing.
-
-**Example:**
-```tomo
-t := {"A"=1, "B"=2}
-t.set("C", 3)
->> t
-= {"A"=1, "B"=2, "C"=3}
-```
+[API documentation](../api/tables.md)
diff --git a/docs/text.md b/docs/text.md
index 35196d25..45ee9a09 100644
--- a/docs/text.md
+++ b/docs/text.md
@@ -145,7 +145,7 @@ These text literals can be used as interpolation values with or without
parentheses, depending on which you find more readable:
```
-two_lines := "one$(\n)two"
+two_lines := "one\ntwo"
has_quotes := "some $\"quotes$\" here"
```
@@ -262,976 +262,6 @@ created that has text with the codepoint `U+E9` as a key, then a lookup with
the same text but with `U+65 U+301` instead of `U+E9` will still succeed in
finding the value because the two texts are equivalent under normalization.
-## Text Functions
+# API
-- [`func as_c_string(text: Text -> CString)`](#as_c_string)
-- [`func at(text: Text, index: Int -> Text)`](#at)
-- [`func by_line(text: Text -> func(->Text?))`](#by_line)
-- [`func by_split(text: Text, delimiter: Text = "" -> func(->Text?))`](#by_split)
-- [`func by_split_any(text: Text, delimiters: Text = " $\t\r\n" -> func(->Text?))`](#by_split_any)
-- [`func bytes(text: Text -> [Byte])`](#bytes)
-- [`func caseless_equals(a: Text, b:Text, language:Text = "C" -> Bool)`](#caseless_equals)
-- [`func codepoint_names(text: Text -> [Text])`](#codepoint_names)
-- [`func ends_with(text: Text, suffix: Text -> Bool)`](#ends_with)
-- [`func from(text: Text, first: Int -> Text)`](#from)
-- [`func from_bytes(codepoints: [Int32] -> [Text])`](#from_bytes)
-- [`func from_c_string(str: CString -> Text)`](#from_c_string)
-- [`func from_codepoint_names(codepoint_names: [Text] -> [Text])`](#from_codepoint_names)
-- [`func from_codepoints(codepoints: [Int32] -> [Text])`](#from_codepoints)
-- [`func has(text: Text, target: Text -> Bool)`](#has)
-- [`func join(glue: Text, pieces: [Text] -> Text)`](#join)
-- [`func split(text: Text, delimiter: Text = "" -> [Text])`](#split)
-- [`func split_any(text: Text, delimiters: Text = " $\t\r\n" -> [Text])`](#split_any)
-- [`func middle_pad(text: Text, width: Int, pad: Text = " ", language: Text = "C" -> Text)`](#middle_pad)
-- [`func left_pad(text: Text, width: Int, pad: Text = " ", language: Text = "C" -> Text)`](#left_pad)
-- [`func lines(text: Text -> [Text])`](#lines)
-- [`func lower(text: Text, language: Text = "C" -> Text)`](#lower)
-- [`func quoted(text: Text, color: Bool = no, quotation_mark: Text = '"' -> Text)`](#quoted)
-- [`func repeat(text: Text, count:Int -> Text)`](#repeat)
-- [`func replace(text: Text, target: Text, replacement: Text -> Text)`](#replace)
-- [`func reversed(text: Text -> Text)`](#reversed)
-- [`func right_pad(text: Text, width: Int, pad: Text = " ", language: Text = "C" -> Text)`](#right_pad)
-- [`func slice(text: Text, from: Int = 1, to: Int = -1 -> Text)`](#slice)
-- [`func starts_with(text: Text, prefix: Text -> Bool)`](#starts_with)
-- [`func title(text: Text, language: Text = "C" -> Text)`](#title)
-- [`func to(text: Text, last: Int -> Text)`](#to)
-- [`func translate(translations:{Text=Text} -> Text)`](#translate)
-- [`func trim(text: Text, to_trim: Text = " $\t\r\n", left: Bool = yes, right: Bool = yes -> Text)`](#trim)
-- [`func upper(text: Text, language: Text "C" -> Text)`](#upper)
-- [`func utf32_codepoints(text: Text -> [Int32])`](#utf32_codepoints)
-- [`func width(text: Text -> Int)`](#width)
-- [`func without_prefix(text: Text, prefix: Text -> Text)`](#without_prefix)
-- [`func without_suffix(text: Text, suffix: Text -> Text)`](#without_suffix)
-
-----------------
-
-### `as_c_string`
-Converts a `Text` value to a C-style string.
-
-```tomo
-func as_c_string(text: Text -> CString)
-```
-
-- `text`: The text to be converted to a C-style string.
-
-**Returns:**
-A C-style string (`CString`) representing the text.
-
-**Example:**
-```tomo
->> "Hello".as_c_string()
-= CString("Hello")
-```
-
----
-
-### `at`
-Get the graphical cluster at a given index. This is similar to `str[i]` with
-ASCII text, but has more correct behavior for unicode text.
-
-```tomo
-func at(text: Text, index: Int -> Text)
-```
-
-- `text`: The text from which to get a cluster.
-- `index`: The index of the graphical cluster (1-indexed).
-
-**Returns:**
-A `Text` with the single graphical cluster at the given index. Note: negative
-indices are counted from the back of the text, so `-1` means the last cluster,
-`-2` means the second-to-last, and so on.
-
-**Example:**
-```tomo
->> "Amélie".at(3)
-= "é"
-```
-
----
-
-### `by_line`
-Returns an iterator function that can be used to iterate over the lines in a
-text.
-
-```tomo
-func by_line(text: Text -> func(->Text?))
-```
-
-- `text`: The text to be iterated over, line by line.
-
-**Returns:**
-An iterator function that returns one line at a time, until it runs out and
-returns `none`. **Note:** this function ignores a trailing newline if there is
-one. If you don't want this behavior, use `text.by_split($/{1 nl}/)` instead.
-
-**Example:**
-```tomo
-text := "
- line one
- line two
-"
-for line in text.by_line()
- # Prints: "line one" then "line two":
- say(line)
-```
-
----
-
-### `by_split`
-Returns an iterator function that can be used to iterate over text separated by
-a delimiter.
-**Note:** to split based on a set of delimiters, use [`by_split_any()`](#by_split_any).
-
-```tomo
-func by_split(text: Text, delimiter: Text = "" -> func(->Text?))
-```
-
-- `text`: The text to be iterated over in delimited chunks.
-- `delimiter`: An exact delimiter to use for splitting the text. If an empty text
- is given, then each split will be the graphical clusters of the text.
-
-**Returns:**
-An iterator function that returns one chunk of text at a time, separated by the
-given delimiter, until it runs out and returns `none`. **Note:** using an empty
-delimiter (the default) will iterate over single grapheme clusters in the text.
-
-**Example:**
-```tomo
-text := "one,two,three"
-for chunk in text.by_split(",")
- # Prints: "one" then "two" then "three":
- say(chunk)
-```
-
----
-
-### `by_split_any`
-Returns an iterator function that can be used to iterate over text separated by
-one or more characters (grapheme clusters) from a given text of delimiters.
-**Note:** to split based on an exact delimiter, use [`by_split()`](#by_split).
-
-```tomo
-func by_split_any(text: Text, delimiters: Text = " $\t\r\n" -> func(->Text?))
-```
-
-- `text`: The text to be iterated over in delimited chunks.
-- `delimiters`: An text containing multiple delimiter characters (grapheme clusters)
- to use for splitting the text.
-
-**Returns:**
-An iterator function that returns one chunk of text at a time, separated by the
-given delimiter characters, until it runs out and returns `none`.
-
-**Example:**
-```tomo
-text := "one,two,;,three"
-for chunk in text.by_split_any(",;")
- # Prints: "one" then "two" then "three":
- say(chunk)
-```
-
----
-
-### `bytes`
-Converts a `Text` value to a list of bytes representing a UTF8 encoding of
-the text.
-
-```tomo
-func bytes(text: Text -> [Byte])
-```
-
-- `text`: The text to be converted to UTF8 bytes.
-
-**Returns:**
-A list of bytes (`[Byte]`) representing the text in UTF8 encoding.
-
-**Example:**
-```tomo
->> "Amélie".bytes()
-= [65[B], 109[B], 195[B], 169[B], 108[B], 105[B], 101[B]] : [Byte]
-```
-
----
-
-### `caseless_equals`
-Checks whether two texts are equal, ignoring the casing of the letters (i.e.
-case-insensitive comparison).
-
-```tomo
-func caseless_equals(a: Text, b:Text, language:Text = "C" -> Bool)
-```
-
-- `a`: The first text to compare case-insensitively.
-- `b`: The second text to compare case-insensitively.
-- `language`: The ISO 639 language code for which casing rules to use.
-
-**Returns:**
-`yes` if `a` and `b` are equal to each other, ignoring casing, otherwise `no`.
-
-**Example:**
-```tomo
->> "A".caseless_equals("a")
-= yes
-
-# Turkish lowercase "I" is "ı" (dotless I), not "i"
->> "I".caseless_equals("i", language="tr_TR")
-= no
-```
-
----
-
-### `codepoint_names`
-Returns a list of the names of each codepoint in the text.
-
-```tomo
-func codepoint_names(text: Text -> [Text])
-```
-
-- `text`: The text from which to extract codepoint names.
-
-**Returns:**
-A list of codepoint names (`[Text]`).
-
-**Example:**
-```tomo
->> "Amélie".codepoint_names()
-= ["LATIN CAPITAL LETTER A", "LATIN SMALL LETTER M", "LATIN SMALL LETTER E WITH ACUTE", "LATIN SMALL LETTER L", "LATIN SMALL LETTER I", "LATIN SMALL LETTER E"]
-```
-
----
-
-### `ends_with`
-Checks if the `Text` ends with a literal suffix text.
-
-```tomo
-func ends_with(text: Text, suffix: Text -> Bool)
-```
-
-- `text`: The text to be searched.
-- `suffix`: The literal suffix text to check for.
-
-**Returns:**
-`yes` if the text has the target, `no` otherwise.
-
-**Example:**
-```tomo
->> "hello world".ends_with("world")
-= yes
-```
-
----
-
-### `from`
-Get a slice of the text, starting at the given position.
-
-```tomo
-func from(text: Text, first: Int -> Text)
-```
-
-- `text`: The text to be sliced.
-- `frist`: The index of the first grapheme cluster to include (1-indexed).
-
-**Returns:**
-The text from the given grapheme cluster to the end of the text. Note: a
-negative index counts backwards from the end of the text, so `-1` refers to the
-last cluster, `-2` the second-to-last, etc. Slice ranges will be truncated to
-the length of the text.
-
-**Example:**
-```tomo
->> "hello".from(2)
-= "ello"
-
->> "hello".from(-2)
-= "lo"
-```
-
----
-
-### `from_bytes`
-Returns text that has been constructed from the given UTF8 bytes. Note: the
-text will be normalized, so the resulting text's UTF8 bytes may not exactly
-match the input.
-
-```tomo
-func from_bytes(bytes: [Byte] -> [Text])
-```
-
-- `bytes`: The UTF-8 bytes of the desired text.
-
-**Returns:**
-A new text based on the input UTF8 bytes after normalization has been applied.
-
-**Example:**
-```tomo
->> Text.from_bytes([195[B], 133[B], 107[B], 101[B]])
-= "Åke"
-```
-
----
-
-### `from_c_string`
-Converts a C-style string to a `Text` value.
-
-```tomo
-func from_c_string(str: CString -> Text)
-```
-
-- `str`: The C-style string to be converted.
-
-**Returns:**
-A `Text` value representing the C-style string.
-
-**Example:**
-```tomo
->> Text.from_c_string(CString("Hello"))
-= "Hello"
-```
-
----
-
-### `from_codepoint_names`
-Returns text that has the given codepoint names (according to the Unicode
-specification) as its codepoints. Note: the text will be normalized, so the
-resulting text's codepoints may not exactly match the input codepoints.
-
-```tomo
-func from_codepoint_names(codepoint_names: [Text] -> [Text])
-```
-
-- `codepoint_names`: The names of each codepoint in the desired text. Names
- are case-insentive.
-
-**Returns:**
-A new text with the specified codepoints after normalization has been applied.
-Any invalid names are ignored.
-
-**Example:**
-```tomo
->> Text.from_codepoint_names([
- "LATIN CAPITAL LETTER A WITH RING ABOVE",
- "LATIN SMALL LETTER K",
- "LATIN SMALL LETTER E",
-]
-= "Åke"
-```
-
----
-
-### `from_codepoints`
-Returns text that has been constructed from the given UTF32 codepoints. Note:
-the text will be normalized, so the resulting text's codepoints may not exactly
-match the input codepoints.
-
-```tomo
-func from_codepoints(codepoints: [Int32] -> [Text])
-```
-
-- `codepoints`: The UTF32 codepoints in the desired text.
-
-**Returns:**
-A new text with the specified codepoints after normalization has been applied.
-
-**Example:**
-```tomo
->> Text.from_codepoints([197[32], 107[32], 101[32]])
-= "Åke"
-```
-
----
-
-### `has`
-Checks if the `Text` contains some target text.
-
-```tomo
-func has(text: Text, target: Text -> Bool)
-```
-
-- `text`: The text to be searched.
-- `target`: The text to search for.
-
-**Returns:**
-`yes` if the target text is found, `no` otherwise.
-
-**Example:**
-```tomo
->> "hello world".has("wo")
-= yes
->> "hello world".has("xxx")
-= no
-```
-
----
-
-### `join`
-Joins a list of text pieces with a specified glue.
-
-```tomo
-func join(glue: Text, pieces: [Text] -> Text)
-```
-
-- `glue`: The text used to join the pieces.
-- `pieces`: The list of text pieces to be joined.
-
-**Returns:**
-A single `Text` value with the pieces joined by the glue.
-
-**Example:**
-```tomo
->> ", ".join(["one", "two", "three"])
-= "one, two, three"
-```
-
----
-
-### `middle_pad`
-Pad some text on the left and right side so it reaches a target width.
-
-```tomo
-func middle_pad(text: Text, width: Int, pad: Text = " ", language: Text = "C" -> Text)
-```
-
-- `text`: The text to pad.
-- `width`: The target width.
-- `pad`: The padding text (default: `" "`).
-- `language`: The ISO 639 language code for which character width to use.
-
-**Returns:**
-Text with length at least `width`, with extra padding on the left and right as
-needed. If `pad` has length greater than 1, it may be partially repeated to
-reach the exact desired length.
-
-**Example:**
-```tomo
->> "x".middle_pad(6)
-= " x "
->> "x".middle_pad(10, "ABC")
-= "ABCAxABCAB"
-```
-
----
-
-### `left_pad`
-Pad some text on the left side so it reaches a target width.
-
-```tomo
-func left_pad(text: Text, width: Int, pad: Text = " ", language: Text = "C" -> Text)
-```
-
-- `text`: The text to pad.
-- `width`: The target width.
-- `pad`: The padding text (default: `" "`).
-- `language`: The ISO 639 language code for which character width to use.
-
-**Returns:**
-Text with length at least `width`, with extra padding on the left as needed. If
-`pad` has length greater than 1, it may be partially repeated to reach the
-exact desired length.
-
-**Example:**
-```tomo
->> "x".left_pad(5)
-= " x"
->> "x".left_pad(5, "ABC")
-= "ABCAx"
-```
-
----
-
-### `lines`
-Splits the text into a list of lines of text, preserving blank lines,
-ignoring trailing newlines, and handling `\r\n` the same as `\n`.
-
-```tomo
-func lines(text: Text -> [Text])
-```
-
-- `text`: The text to be split into lines.
-
-**Returns:**
-A list of substrings resulting from the split.
-
-**Example:**
-```tomo
->> "one$(\n)two$(\n)three".lines()
-= ["one", "two", "three"]
->> "one$(\n)two$(\n)three$(\n)".lines()
-= ["one", "two", "three"]
->> "one$(\n)two$(\n)three$(\n\n)".lines()
-= ["one", "two", "three", ""]
->> "one$(\r\n)two$(\r\n)three$(\r\n)".lines()
-= ["one", "two", "three"]
->> "".lines()
-= []
-```
-
----
-
-### `lower`
-Converts all characters in the text to lowercase.
-
-```tomo
-func lower(text: Text, language: Text = "C" -> Text)
-```
-
-- `text`: The text to be converted to lowercase.
-- `language`: The ISO 639 language code for which casing rules to use.
-
-**Returns:**
-The lowercase version of the text.
-
-**Example:**
-```tomo
->> "AMÉLIE".lower()
-= "amélie"
-
->> "I".lower(language="tr_TR")
->> "ı"
-```
-
----
-
-### `quoted`
-Formats the text with quotation marks and escapes.
-
-```tomo
-func quoted(text: Text, color: Bool = no, quotation_mark: Text = '"' -> Text)
-```
-
-- `text`: The text to be quoted.
-- `color`: Whether to add color formatting (default is `no`).
-- `quotation_mark`: The quotation mark to use (default is `"`).
-
-**Returns:**
-The text formatted as a quoted text.
-
-**Example:**
-```tomo
->> "one$(\n)two".quoted()
-= "\"one\\ntwo\""
-```
-
----
-
-### `repeat`
-Repeat some text multiple times.
-
-```tomo
-func repeat(text: Text, count:Int -> Text)
-```
-
-- `text`: The text to repeat.
-- `count`: The number of times to repeat it. (Negative numbers are equivalent to zero).
-
-**Returns:**
-The text repeated the given number of times.
-
-**Example:**
-```tomo
->> "Abc".repeat(3)
-= "AbcAbcAbc"
-```
-
----
-
-### `replace`
-Replaces occurrences of a target text with a replacement text.
-
-```tomo
-func replace(text: Text, target: Text, replacement: Text -> Text)
-```
-
-- `text`: The text in which to perform replacements.
-- `target`: The target text to be replaced.
-- `replacement`: The text to replace the target with.
-
-**Returns:**
-The text with occurrences of the target replaced.
-
-**Example:**
-```tomo
->> "Hello world".replace("world", "there")
-= "Hello there"
-```
-
----
-
-### `reversed`
-Return a text that has the grapheme clusters in reverse order.
-
-```tomo
-func reversed(text: Text -> Text)
-```
-
-- `text`: The text to reverse.
-
-**Returns:**
-A reversed version of the text.
-
-**Example:**
-```tomo
->> "Abc".reversed()
-= "cbA"
-```
-
----
-
-### `right_pad`
-Pad some text on the right side so it reaches a target width.
-
-```tomo
-func right_pad(text: Text, width: Int, pad: Text = " ", language: Text = "C" -> Text)
-```
-
-- `text`: The text to pad.
-- `width`: The target width.
-- `pad`: The padding text (default: `" "`).
-- `language`: The ISO 639 language code for which character width to use.
-
-**Returns:**
-Text with length at least `width`, with extra padding on the right as needed. If
-`pad` has length greater than 1, it may be partially repeated to reach the
-exact desired length.
-
-**Example:**
-```tomo
->> "x".right_pad(5)
-= "x "
->> "x".right_pad(5, "ABC")
-= "xABCA"
-```
-
----
-
-### `slice`
-Get a slice of the text.
-
-```tomo
-func slice(text: Text, from: Int = 1, to: Int = -1 -> Text)
-```
-
-- `text`: The text to be sliced.
-- `from`: The index of the first grapheme cluster to include (1-indexed).
-- `to`: The index of the last grapheme cluster to include (1-indexed).
-
-**Returns:**
-The text that spans the given grapheme cluster indices. Note: a negative index
-counts backwards from the end of the text, so `-1` refers to the last cluster,
-`-2` the second-to-last, etc. Slice ranges will be truncated to the length of
-the text.
-
-**Example:**
-```tomo
->> "hello".slice(2, 3)
-= "el"
-
->> "hello".slice(to=-2)
-= "hell"
-
->> "hello".slice(from=2)
-= "ello"
-```
-
----
-
-### `split`
-Splits the text into a list of substrings based on exact matches of a delimiter.
-**Note:** to split based on a set of delimiter characters, use [`split_any()`](#split_any).
-
-```tomo
-func split(text: Text, delimiter: Text = "" -> [Text])
-```
-
-- `text`: The text to be split.
-- `delimiter`: The delimiter used to split the text. If the delimiter is the
- empty text, the text will be split into individual grapheme clusters.
-
-**Returns:**
-A list of subtexts resulting from the split.
-
-**Example:**
-```tomo
->> "one,two,,three".split(",")
-= ["one", "two", "", "three"]
-
->> "abc".split()
-= ["a", "b", "c"]
-```
-
----
-
-### `split_any`
-Splits the text into a list of substrings at one or more occurrences of a set
-of delimiter characters (grapheme clusters).
-**Note:** to split based on an exact delimiter, use [`split()`](#split).
-
-```tomo
-func split_any(text: Text, delimiters: Text = " $\t\r\n" -> [Text])
-```
-
-- `text`: The text to be split.
-- `delimiters`: A text containing multiple delimiters to be used for
- splitting the text into chunks.
-
-**Returns:**
-A list of subtexts resulting from the split.
-
-**Example:**
-```tomo
->> "one, two,,three".split_any(", ")
-= ["one", "two", "three"]
-```
-
----
-
-### `starts_with`
-Checks if the `Text` starts with a literal prefix text.
-
-```tomo
-func starts_with(text: Text, prefix: Text -> Bool)
-```
-
-- `text`: The text to be searched.
-- `prefix`: The literal prefix text to check for.
-
-**Returns:**
-`yes` if the text has the given prefix, `no` otherwise.
-
-**Example:**
-```tomo
->> "hello world".starts_with("hello")
-= yes
-```
-
----
-
-### `title`
-Converts the text to title case (capitalizing the first letter of each word).
-
-```tomo
-func title(text: Text, language: Text = "C" -> Text)
-```
-
-- `text`: The text to be converted to title case.
-- `language`: The ISO 639 language code for which casing rules to use.
-
-**Returns:**
-The text in title case.
-
-**Example:**
-```tomo
->> "amélie".title()
-= "Amélie"
-
-# In Turkish, uppercase "i" is "İ"
->> "i".title(language="tr_TR")
-= "İ"
-```
-
----
-
-### `to`
-Get a slice of the text, ending at the given position.
-
-```tomo
-func to(text: Text, last: Int -> Text)
-```
-
-- `text`: The text to be sliced.
-- `last`: The index of the last grapheme cluster to include (1-indexed).
-
-**Returns:**
-The text up to and including the given grapheme cluster. Note: a negative index
-counts backwards from the end of the text, so `-1` refers to the last cluster,
-`-2` the second-to-last, etc. Slice ranges will be truncated to the length of
-the text.
-
-**Example:**
-```tomo
->> "goodbye".to(3)
-= "goo"
-
->> "goodbye".to(-2)
-= "goodby"
-```
-
----
-
-### `translate`
-Takes a table mapping target texts to their replacements and performs all the
-replacements in the table on the whole text. At each position, the first
-matching replacement is applied and the matching moves on to *after* the
-replacement text, so replacement text is not recursively modified. See
-[`replace()`](#replace) for more information about replacement behavior.
-
-```tomo
-func translate(translations:{Text=Text} -> Text)
-```
-
-- `text`: The text in which to perform replacements.
-- `translations`: A table mapping from target text to its replacement.
-
-**Returns:**
-The text with all occurrences of the targets replaced with their corresponding
-replacement text.
-
-**Example:**
-```tomo
->> "A <tag> & an amperand".translate({
- "&" = "&amp;",
- "<" = "&lt;",
- ">" = "&gt;",
- '"" = "&quot",
- "'" = "&#39;",
-}
-= "A &lt;tag&gt; &amp; an ampersand"
-```
-
----
-
-### `trim`
-Trims the given characters (grapheme clusters) from the left and/or right side of the text.
-
-```tomo
-func trim(text: Text, to_trim: Text = " $\t\r\n", left: Bool = yes, right: Bool = yes -> Text)
-```
-
-- `text`: The text to be trimmed.
-- `to_trim`: The characters to remove from the left/right of the text.
-- `left`: Whether or not to trim from the front of the text.
-- `right`: Whether or not to trim from the back of the text.
-
-**Returns:**
-The text without the trim characters at either end.
-
-**Example:**
-```tomo
->> " x y z $(\n)".trim()
-= "x y z"
-
->> "one,".trim(",")
-= "one"
-
->> " xyz ".trim(right=no)
-= "xyz "
-```
-
----
-
-### `upper`
-Converts all characters in the text to uppercase.
-
-```tomo
-func upper(text: Text, language: Text = "C" -> Text)
-```
-
-- `text`: The text to be converted to uppercase.
-- `language`: The ISO 639 language code for which casing rules to use.
-
-**Returns:**
-The uppercase version of the text.
-
-**Example:**
-```tomo
->> "amélie".upper()
-= "AMÉLIE"
-
-# In Turkish, uppercase "i" is "İ"
->> "i".upper(language="tr_TR")
-= "İ"
-```
-
----
-
-### `utf32_codepoints`
-Returns a list of Unicode code points for UTF32 encoding of the text.
-
-```tomo
-func utf32_codepoints(text: Text -> [Int32])
-```
-
-- `text`: The text from which to extract Unicode code points.
-
-**Returns:**
-A list of 32-bit integer Unicode code points (`[Int32]`).
-
-**Example:**
-```tomo
->> "Amélie".utf32_codepoints()
-= [65[32], 109[32], 233[32], 108[32], 105[32], 101[32]] : [Int32]
-```
-
----
-
-### `width`
-Returns the display width of the text as seen in a terminal with appropriate
-font rendering. This is usually the same as the text's `.length`, but there are
-some characters like emojis that render wider than 1 cell.
-
-**Warning:** This will not always be exactly accurate when your terminal's font
-rendering can't handle some unicode displaying correctly.
-
-```tomo
-func width(text: Text -> Int)
-```
-
-- `text`: The text whose length you want.
-
-**Returns:**
-An integer representing the display width of the text.
-
-**Example:**
-```tomo
->> "Amélie".width()
-= 6
->> "🤠".width()
-= 2
-```
-
----
-
-### `without_prefix`
-Returns the text with a given prefix removed (if present).
-
-```tomo
-func without_prefix(text: Text, prefix: Text -> Text)
-```
-
-- `text`: The text to remove the prefix from.
-- `prefix`: The prefix to remove.
-
-**Returns:**
-A text without the given prefix (if present) or the unmodified text if the
-prefix is not present.
-
-**Example:**
-```tomo
->> "foo:baz".without_prefix("foo:")
-= "baz"
->> "qux".without_prefix("foo:")
-= "qux"
-```
-
----
-
-### `without_suffix`
-Returns the text with a given suffix removed (if present).
-
-```tomo
-func without_suffix(text: Text, suffix: Text -> Text)
-```
-
-- `text`: The text to remove the suffix from.
-- `suffix`: The suffix to remove.
-
-**Returns:**
-A text without the given suffix (if present) or the unmodified text if the
-suffix is not present.
-
-**Example:**
-```tomo
->> "baz.foo".without_suffix(".foo")
-= "baz"
->> "qux".without_suffix(".foo")
-= "qux"
-```
+[API documentation](../api/text.md)
diff --git a/docs/tomo.1 b/docs/tomo.1
deleted file mode 100644
index bbc90f8e..00000000
--- a/docs/tomo.1
+++ /dev/null
@@ -1,75 +0,0 @@
-.\" Automatically generated by Pandoc 3.1.12.1
-.\"
-.TH "TOMO" "1" "June 11, 2024" "" ""
-.SH NAME
-tomo \- The programming language of tomorrow.
-.SH SYNOPSIS
-.TP
-Run the REPL:
-\f[B]tomo\f[R]
-.TP
-Run a program:
-\f[B]tomo\f[R] \f[I]program.tm\f[R] [[\f[B]\-\-\f[R]]
-\f[I]args\&...\f[R]]
-.TP
-Transpile tomo files to C files:
-\f[B]tomo\f[R] \f[B]\-t\f[R] \f[I]file1.tm\f[R] \f[I]file2.tm\f[R]\&...
-.TP
-Compile files to static object files:
-\f[B]tomo\f[R] \f[B]\-c\f[R] \f[I]file1.tm\f[R] \f[I]file2.tm\f[R]\&...
-.TP
-Compile file to an executable:
-\f[B]tomo\f[R] \f[B]\-e\f[R] \f[I]file1.tm\f[R]
-.TP
-Build a shared library:
-\f[B]tomo\f[R] \f[B]\-s=\f[R]\f[I]mylib.1.2.3\f[R] \f[I]file1.tm\f[R]
-\f[I]file2.tm\f[R]\&...
-.SH DESCRIPTION
-Tomo is a programming language that is statically typed, compiled,
-small, and garbage\-collected, with concise syntax and built\-in support
-for high\-performance, low\-overhead datastructures.
-It compiles by first outputting C code, which is then compiled using a C
-compiler of your choice.
-.SH OPTIONS
-.TP
-\f[B]\-h\f[R], \f[B]\-\-help\f[R]
-Print the usage and exit.
-.TP
-\f[B]\-t\f[R], \f[B]\-\-transpile\f[R]
-Transpile the input files to C code without compiling them.
-.TP
-\f[B]\-c\f[R], \f[B]\-\-compile\-obj\f[R]
-Compile the input files to static objects, rather than running them.
-.TP
-\f[B]\-e\f[R], \f[B]\-\-compile\-exe\f[R]
-Compile the input file to an executable.
-.TP
-\f[B]\-L\f[R], \f[B]\-\-library\f[R]
-Compile the input files to a shared library file and header.
-.TP
-\f[B]\-I\f[R], \f[B]\-\-install\f[R]
-Install the compiled executable or library.
-.TP
-\f[B]\-C\f[R] \f[I]\f[R], \f[B]\-\-show\-codegen\f[R] \f[I]\f[R]
-Set a program (e.g.\ \f[B]cat\f[R] or \f[B]bat\f[R]) to display the
-generated code
-.TP
-\f[B]\-\-c\-compiler\f[R]
-Set which C compiler is used.
-.TP
-\f[B]\-O\f[R] \f[B]level\f[R], \f[B]\-\-optimization\f[R] \f[B]level\f[R]
-Set the optimization level.
-.TP
-\f[B]\-v\f[R], \f[B]\-\-verbose\f[R]
-Print extra verbose output.
-.TP
-\f[B]\-r\f[R], \f[B]\-\-run\f[R]
-Run an installed tomo program from
-\f[B]\[ti]/.local/share/tomo/installed\f[R].
-.SS ENVIRONMENT VARIABLES
-Some options can be configured by setting environment variables.
-.TP
-\f[B]CC=\f[R]\f[I]c\-compiler\f[R]
-Set which C compiler is used.
-.SH AUTHORS
-Bruce Hill (\f[I]bruce\[at]bruce\-hill.com\f[R]).