This page provides a quick orientation to the standard library located under https://git.xw3.org/fun/fun/src/branch/main/lib.

The stdlib is written in Fun and organized by domain. Below is the current layout with brief notes. Refer to the source for full APIs and examples.

Top-level modules

  • arrays.fun - helpers for working with array structures.
  • cli.fun - minimal helpers for building CLI tools.
  • hello.fun - simple demonstration helper(s).
  • hex.fun - hexadecimal encode/decode helpers.
  • math.fun - math helpers in Fun.
  • regex.fun - simple regex-related helpers (see also regex/).
  • strings.fun - string manipulation utilities.

Packages

Note: Availability of some modules can depend on optional extensions selected at build time (see Build). For instance, regex/pcre2.fun requires PCRE2 support; ui/* depends on chosen UI backends.

Using modules

#include <strings.fun>

s = trim("  hello  ")
print(s)

For search paths and namespacing details, see Includes and CLI (FUN_LIB_DIR and DEFAULT_LIB_DIR).

Comments