Skip to content

Standard Library

The Prove standard library is a set of 19 modules (plus aliases) that ship with the compiler. Each module is a .prv file declaring types and function signatures, backed by a C implementation that the compiler links into the final binary.


Core Concepts

Verb Families

Verbs define what a function does. The compiler enforces their guarantees:

Family Verbs Guarantees
Pure transforms, validates, reads, creates, matches No IO, no side effects. Safe to memoize, parallelize
IO inputs, outputs, streams Reads/writes to external world
Async detached, attached, listens Concurrent execution via coroutines

See Functions & Verbs for the full reference.

Channel Dispatch

Many modules organize functions by channel — the same name with different verbs:

# Three operations on "file", resolved by verb at call site
inputs file(path String) String!      // read file
outputs file(path String, content String)!  // write file
validates file(path String)           // check if exists

The caller's context determines which function is invoked. This is verb-dispatched identity — see Functions & Verbs.

Always-Available Types

These types need no import:

  • Primitives: Integer, Decimal, Float, Boolean, String, Character, Byte, Unit
  • Containers: List<Value>, Option<Value>, Result<Value, Error>, Table<Value>
  • Special: Value, Error, Source

Module Summary

Module Status Purpose
Character Complete Character classification (alpha, digit, space, etc.) and string-to-char access
Text Complete String operations (slice, contains, split, join, trim, replace) and StringBuilder for efficient string construction
Table Complete Hash map Table<Value> with creates new, reads get, transforms add, validates has
List Complete Operations on List<Value>: length, first, last, contains, sort, reverse, range
Array Complete Fixed-size contiguous arrays Array<T> with typed elements; supports copy-on-write and :[Mutable] in-place variants
System Complete Channels: console, file, system, dir, process with validates verbs
Parse Complete JSON, TOML, URL, Base64, and CSV codecs with Value and Url types
Math Complete Numeric functions: abs, min, max, floor, ceil, pow, clamp, sqrt, log
Types Complete Type validation and conversion: String ↔ Integer, String ↔ Float, Character ↔ Integer; Result/Option validators and unwrap
Path Complete File path manipulation: join, parent, stem, extension, normalize
Pattern Complete Regex operations: test, search, replace, split with Match type
Format Complete String/number formatting (pad, hex, bin) and time/date formatting
Bytes Complete Byte sequence manipulation: create, slice, hex encode/decode, index access
Hash Complete Cryptographic hashing: SHA-256, SHA-512, BLAKE3, HMAC-SHA256
Random Complete Random value generation: integer, decimal, boolean, choice, shuffle
Time Complete Time, Date, Clock, Duration, DateTime, Weekday with calendar operations
Log Complete ANSI color constants and structured logging with detached verb
Network Complete TCP sockets: socket, server, accept, message channels with Socket type; pairs with streams for accept loops
Language Complete Natural language processing: tokenization, stemming, edit distance, phonetic codes, n-grams, stopwords, frequency analysis