Skip to content

Standard Library

Chris Michael edited this page Sep 2, 2026 · 3 revisions

Pudu

Standard Library

import Std.Text as Text
import Std.Option {map, unwrapOr}

Status: 46 source modules and 1291 exported declarations on the current dev branch. They ship with the compiler, resolve without a network, and are written in Pudu.

The count is a source declaration count, not a compatibility promise. Pudu is pre-release.

Modules

Core data and values

Module Export declarations Focus
Std.Bits 29 Width-aware bit operations and Bits.
Std.Bool 10 Boolean combinators and folds.
Std.Char 29 Character classification, case, and scalar conversion.
Std.Decimal 30 Exact decimal arithmetic, scale, conversion, and rounding.
Std.Function 14 Identity, composition, flipping, and bounded repetition.
Std.Math 27 Generic arithmetic, powers, roots, primality, and ordering helpers.
Std.Num 15 Numeric traits and generic operations.
Std.Option 24 Option transforms, collection, defaults, and Result bridges.
Std.Order 27 Ordering values, Eq, Ord, and derived comparisons.
Std.Result 24 Success/error transforms, collection, recovery, and defaults.
Std.Show 12 Value rendering, containers, padding, and tables.
Std.Tuple 10 Projection, swapping, mapping, currying, and uncurrying.

Collections

Module Export declarations Focus
Std.List 97 Array folds, searches, transforms, ordering, products, and windows.
Std.Map 47 Lookup, transforms, merges, groups, sets of keys, and inversion.
Std.Set 39 Membership, algebra, relations, filters, partitions, and products.
Std.Iter 25 Sequence, ranges, adapters, and consumers.
Std.NonEmpty 29 Sequences that carry non-emptiness in their shape.
Std.Deque 21 Double-ended persistent queue operations.
Std.Heap 18 Heap construction and least-element operations.
Std.Graph 22 Directed graphs, cycles, components, ordering, and paths.
Std.Tree 40 One value with a sequence of trees beneath it, and the walks over that shape.
Std.Mappable 3 A trait over the container itself, written with a parameter of higher kind.

Keyed structures

Std.Map answers what is under an exact key. These answer the questions it cannot.

Module Export declarations Focus
Std.SortedMap 31 Nearest-key questions: floor, ceiling, lower, higher, ranges, and a caller-supplied comparison.
Std.LinkedMap 27 Entries in the order they were inserted, with touch for recency.
Std.EnumMap 22 A fixed domain where every key has a value, so get answers V rather than Option[V].
Std.BiMap 24 A bijection, readable from either side.
Std.MultiMap 30 Many values under one key, where a key with none is absent.
Std.MultiKeyMap 24 A partial index: entries reachable by any of several keys.
Std.LruCache 22 A bounded map that discards by least recent use, so reading keeps an entry alive.
Std.PrefixTrie 25 Text keys held as paths through their characters, walked by prefix and in key order.

Text and formats

Module Export declarations Focus
Std.Text 64 Unicode text transforms, splits, searches, folds, and case.
Std.Text.Parse 69 Parser combinators, controlled backtracking, positions, and common tokens.
Std.Json 19 JSON values, positional decoding errors, and encoding.
Std.Url 16 URL parse/render, queries, percent encoding, and default ports.
Std.Http 99 HTTP data, headers, cookies, auth, negotiation, forms, and ranges.
Std.Http.Message 11 HTTP request/response wire parsing and rendering.

Output and formatting

Module Export declarations Focus
Std.Out 22 A printer as a value: separator, ending, prefix, and stream, with a pure rendered.
Std.Fmt 25 A shaping spec as a value: width, fill, alignment, sign, grouping, radix, and columns. No format strings.

Testing

Module Export declarations Focus
Std.Test 43 Checks and suites as values, tables, conditions, and a report that says what failed.
Std.Test.Property 8 Generated values with shrinking, seeded so a failure repeats exactly.

System and time

Module Export declarations Focus
Std.Io 28 Files, directories, standard streams, and paths.
Std.Env 17 Arguments, environment, platform paths, and exit.
Std.Process 11 Process execution, availability, status, and captured streams.
Std.Time 40 Instants, durations, dates, times, formatting, and parsing.
Std.Random 14 Reproducible generators, ranges, shuffle, sample, and identifiers.
Std.Crypto 8 SHA-256, UTF-8, and constant-time comparison.

Methods versus module functions

Built-in methods come from compiler-owned closed sets on Array, Str, Map, Set, and Char, plus methods supplied by program impl blocks. Other standard-library operations are module functions whose first argument is the value.

text.length()
Option.unwrapOr(value, fallback)

This rule is mechanical. E3033 explains a common wrong-side lookup.

Effect boundary

Effects use prelude operations and standard wrappers for files, environment, clock, processes, and console IO. They return recoverable carriers where the operation can fail. Compile-time evaluation denies these effects.

Source

The complete signatures and implementations are under lib/Std. Use pudu doc, pudu doc --json, or pudu doc --html to generate an index for the exact program graph you are working with.

Related

Clone this wiki locally