> For the complete documentation index, see [llms.txt](https://opfn.gitbook.io/pallas/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://opfn.gitbook.io/pallas/sire-reference/wip-standard-library.md).

# Standard Library

## Finding additional standard library functions

The entire "standard library" is defined in the consecutively-numbered `sire/sire_<n>_<name>.sire` files. The files are quite readable and we encourage you to explore after becoming familiar with the documentation.

When first navigating a file, check out the list of imports at the top to see what *this* file depends on.  Skimming the list of exports at the bottom (after reading any initial comment at the very top) can give you a sense of file content. Often, the `=?=` test cases can be very helpful.

### Summary of the standard library files

Below is a summary of each of the standard library files. Particularly helpful ones for a beginner are annotated with a 👍. Files that require a more advanced understanding are annotated with a ❗. Most of these files define lower-level dependencies that other higher-order (and easier to understand) subsequent functions rely on.

* [`sire_01_fan.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_01_fan.sire) - Defines named wrappers around PLAN operations
* [`sire_02_bit.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_02_bit.sire) - Booleans
* [`sire_03_nat.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_03_nat.sire) - Natural numbers and operating on them
* [`sire_04_cmp.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_04_cmp.sire) - Comparison, ordering and equality
* [`sire_05_row.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_05_row.sire) - Rows and basic operations on them
* ❗ [`sire_06_rex.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_06_rex.sire) - Representation for rex trees - mostly needed for macros.
* 👍 [`sire_07_dat.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_07_dat.sire) - Data structures; rows, lists, maybe, either, etc.
* 👍 [`sire_10_str.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_10_str.sire) - ASCII characters and strings
* [`sire_11_set.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_11_set.sire) - Sets
* 👍 [`sire_12_tab.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_12_tab.sire) - Tabs
* ❗ [`sire_13_exp.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_13_exp.sire) - More rex and macro utilities
* ❗ [`sire_14_hax.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_14_hax.sire) - Explains how the `#` rune is used for macros
* ❗ [`sire_15_pad.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_15_pad.sire) - Bit-strings encoded as nats
* 👍 [`sire_16_bar.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_16_bar.sire) - Byte-arrays and operations
* [`sire_17_sug.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_17_sug.sire) - Syntactic sugar and convenience macros
* ❗ [`sire_18_pat.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_18_pat.sire) - Pattern matching
* ❗ [`sire_19_bst.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_19_bst.sire) - Binary search trees
* ❗ [`sire_20_prp.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_20_prp.sire) - Sire properties
* [`sire_21_switch.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_21_switch.sire) - Atomic switch
* ❗ [`sire_22_seed.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_22_seed.sire) - Seed; serialization framework
* ❗ [`sire_23_repl.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_23_repl.sire) - REPL utilities
* ❗ [`sire_24_rex.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_24_rex.sire) - Rex
* [`sire_25_datatype.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_25_datatype.sire) - Datacase/Record
* ⁉️ [`sire_26_compile.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_26_compile.sire) - Backend of the sire compiler
* ⁉️ [`sire_27_sire.sire`](https://github.com/operating-function/pallas/blob/master/sire/sire_27_sire.sire) - Sire-in-sire; can be used to bootstrap itself

Taking a look at the list above, you can also get a sense of how the Sire source files start at the basics of wrapping PLAN and incrementally build on each other until the full system is realized.<br>

By starting with PLAN and going through all the files above, after a (relatively) small investment of time, you could understand the **entirety** of this computational model. Pretty cool!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://opfn.gitbook.io/pallas/sire-reference/wip-standard-library.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
