Reference pages for the rest of std, and Part III sections on them

Pages for (std eq), (std clr-ord), (std monad), (std effect),
(std hashset), (std orderedset), (std orderedmap), (std inbox),
(std ports), (std net), (std test), (std simpletest), (std stopwatch)
and (std syntax-match), and for the five (std mutable ...) modules in
a directory of their own, as (std stm) has. Part III has a short
section on each group with links to its pages.

🤖 Generated with [ECA](https://eca.dev) (anthropic/claude-opus-5-5)

Co-Authored-By: eca-agent <git@eca.dev>
This commit is contained in:
Linus Björnstam 2026-10-12 07:15:06 +02:00
parent bb8cefba19
commit fb90f971b4
21 changed files with 109 additions and 0 deletions

View file

@ -54,6 +54,56 @@ For more details, see @link["modules/std/stm.html"]{@code{(std stm)}}, @link["mo
This module provides types and functions for handling time. The clock is an argument (with a default that a program can rebind), and the types refuse operations that mean nothing, such as adding a calendar day to an instant. The module separates @code{Date} (a calendar date without a timezone), @code{Time} (a time of day without a timezone), and @code{DateTime} (a date and time without a timezone), as well as handling timezones. This module provides types and functions for handling time. The clock is an argument (with a default that a program can rebind), and the types refuse operations that mean nothing, such as adding a calendar day to an instant. The module separates @code{Date} (a calendar date without a timezone), @code{Time} (a time of day without a timezone), and @code{DateTime} (a date and time without a timezone), as well as handling timezones.
For more details, see @link["modules/std/datetime.html"]{@code{(std datetime)}}. For more details, see @link["modules/std/datetime.html"]{@code{(std datetime)}}.
@subsection{std/eq and std/clr-ord}
@code{(std eq)} has the traits @code{Eq} and @code{Ord}. @code{Eq} has @code{=} and @code{eq-hash}, and every type has an implementation: a type with no implementation of its own uses .NET's @code{Equals} and @code{GetHashCode}. @code{Ord} has one method, @code{compare}. The other functions of the module, such as @code{less?}, @code{least}, @code{greatest}, @code{list-sort}, @code{list-min} and @code{list-max}, use only @code{compare}, so a type that implements @code{compare} gets all of them. Strings compare by code point, so the order is the same on every machine. The prelude re-exports every name of @code{(std eq)}, so you do not usually import it. @code{(std clr-ord)} adds @code{Ord} for the .NET time types, @code{Guid} and @code{Version}.
For more details, see @link["modules/std/eq.html"]{@code{(std eq)}} and @link["modules/std/clr-ord.html"]{@code{(std clr-ord)}}.
@subsection{std/monad}
The @code{Monad} trait has @code{pure} and @code{bind}, with instances for @code{List}, @code{Option} and @code{Result}. A @code{(do ...)} block writes a chain of @code{bind} calls as a list of steps: @code{(:bind x e)}, @code{(:let x e)} and @code{(:return e)}. For @code{Option} and @code{Result}, the block stops at the first @code{None} or @code{Err}. For @code{List}, it runs once for each combination of items.
For more details, see @link["modules/std/monad.html"]{@code{(std monad)}}.
@subsection{std/effect}
Effect handlers that resume once. @code{defeffect} declares operations and their default handlers. A call of an operation calls the handler that is installed, and @code{with-handler} installs other handlers for an extent. A test can, for example, collect what the code logs. A handler runs on the stack of the caller, so it can return a value or raise an exception, and nothing else: no continuation is captured. The prelude declares its own effects, such as @code{log}, @code{warn} and the filesystem operations, so you import this module to handle them.
For more details, see @link["modules/std/effect.html"]{@code{(std effect)}}.
@subsection{std/hashset, std/orderedset and std/orderedmap}
Persistent collections beside the prelude's @code{Map}: an update returns a new collection and does not change the old one. @code{(std hashset)} has the unordered @code{HashSet}, a CHAMP trie that compares elements with @code{Eq}. @code{(std orderedset)} and @code{(std orderedmap)} have @code{OrderedSet} and @code{OrderedMap}, B-trees kept in the order of @code{compare}. They add what the order gives: @code{-min}, @code{-max}, @code{-successor}, @code{-predecessor} and the range walks @code{-range}, @code{-from} and @code{-until}. Each collection has a builder, which makes it in one pass, and a transient, which edits it in place and gives it back as a persistent collection in O(1).
For more details, see @link["modules/std/hashset.html"]{@code{(std hashset)}}, @link["modules/std/orderedset.html"]{@code{(std orderedset)}} and @link["modules/std/orderedmap.html"]{@code{(std orderedmap)}}.
@subsection{std/mutable}
Collections that change in place. Use them for a cache, an index, a worklist or a scratch buffer, where you do not need old versions. @code{(std mutable vec)}, @code{(std mutable map)}, @code{(std mutable set)} and @code{(std mutable heap)} are the .NET @code{List<T>}, @code{Dictionary<K,V>}, @code{HashSet<T>} and @code{PriorityQueue<T,P>} themselves, not wrappers, so .NET code that takes those types accepts them as they are. They compare with .NET's equality and order. @code{(std mutable deque)} is a double-ended queue with O(1) amortized push and pop at both ends. None of them has a lock.
For more details, see @link["modules/std/mutable/vec.html"]{@code{(std mutable vec)}}, @link["modules/std/mutable/map.html"]{@code{(std mutable map)}}, @link["modules/std/mutable/set.html"]{@code{(std mutable set)}}, @link["modules/std/mutable/heap.html"]{@code{(std mutable heap)}} and @link["modules/std/mutable/deque.html"]{@code{(std mutable deque)}}.
@subsection{std/inbox}
An inbox is how .NET code gives work to Bjolang. A thread that is not a fiber, such as a timer, a @code{FileSystemWatcher} or a Kestrel thread, posts an item and returns. A fiber takes the item with its own handlers, parameters and cancellation scope. An inbox always has a capacity, and a @code{WhenFull} policy says what a post does when the inbox is full. @code{inbox-call} is a request and a reply: the .NET caller gets a @code{Task}, and a fiber answers it.
For more details, see @link["modules/std/inbox.html"]{@code{(std inbox)}}.
@subsection{std/ports and std/net}
@code{(std ports)} reads and writes bytes on the prelude's ports. The byte reads @code{read-some-evt}, @code{read-bytes-evt} and @code{eof-evt} are CML events: a read that loses its @code{choose} takes nothing, so a read can race a timeout. @code{read-line} and @code{read-bytes} can be used on the same port. The module also drains ports into lists and vecs, streams them as a @code{Seq} or a channel, and has @code{byte-pipe}, a pair of ports with no file and no network, for tests. @code{(std net)} gives a TCP connection as a pair of these ports, so a protocol written for ports also runs over TCP. @code{accept-evt} is an event too: a branch that loses accepts nothing.
For more details, see @link["modules/std/ports.html"]{@code{(std ports)}} and @link["modules/std/net.html"]{@code{(std net)}}.
@subsection{std/test and std/simpletest}
@code{(std test)} has tests that are silent unless they fail. @code{deftest} registers a test, @code{check} reports the values that it saw when it fails, and @code{(run-tests)} is the @code{main} of the file. Each test runs in a scope with a deadline. The test fails if it leaves a resource open, and the scope waits for the fibers that the test started. @code{bjo test} builds and runs the test files of a project. @code{(std simpletest)} is the older harness: an assertion prints one line, and a failure prints a line that starts with @code{FAILURE:}. Its @code{with-fake-fs}, a filesystem in memory, also works inside a @code{deftest}.
For more details, see @link["modules/std/test.html"]{@code{(std test)}} and @link["modules/std/simpletest.html"]{@code{(std simpletest)}}.
@subsection{std/stopwatch}
Stopwatches that read the ambient clock, so a test can bind a clock and get an exact time. @code{time-it} runs a body a number of times and reports the time and memory that it used.
For more details, see @link["modules/std/stopwatch.html"]{@code{(std stopwatch)}}.
@subsection{std/syntax-match}
@code{syntax-match} takes a form apart with patterns, with @code{...} for repetition. Write macro transformers with it, and build the result with @code{#'}.
For more details, see @link["modules/std/syntax-match.html"]{@code{(std syntax-match)}}.
@subsection{text/bjodat} @subsection{text/bjodat}
bjodat is Bjolang's shapes read as data: no evaluation, no macro expansion, no environment. It is what a package manifest, a lockfile, or a config file is written in. You can parse text straight into a record using @code{bjodat-parse-<Name>}, which avoids intermediate trees and allocations. bjodat is Bjolang's shapes read as data: no evaluation, no macro expansion, no environment. It is what a package manifest, a lockfile, or a config file is written in. You can parse text straight into a record using @code{bjodat-parse-<Name>}, which avoids intermediate trees and allocations.

3
modules/std/clr-ord.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std clr-ord)"))
@generate-docs[#:module "std clr-ord"]

3
modules/std/effect.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std effect)"))
@generate-docs[#:module "std effect"]

3
modules/std/eq.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std eq)"))
@generate-docs[#:module "std eq"]

3
modules/std/hashset.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std hashset)"))
@generate-docs[#:module "std hashset"]

3
modules/std/inbox.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std inbox)"))
@generate-docs[#:module "std inbox"]

3
modules/std/monad.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std monad)"))
@generate-docs[#:module "std monad"]

View file

@ -0,0 +1,3 @@
(meta (title "(std mutable deque)"))
@generate-docs[#:module "std mutable deque"]

View file

@ -0,0 +1,3 @@
(meta (title "(std mutable heap)"))
@generate-docs[#:module "std mutable heap"]

View file

@ -0,0 +1,2 @@
(meta (title "std mutable: collections that change in place")
(sort title))

View file

@ -0,0 +1,3 @@
(meta (title "(std mutable map)"))
@generate-docs[#:module "std mutable map"]

View file

@ -0,0 +1,3 @@
(meta (title "(std mutable set)"))
@generate-docs[#:module "std mutable set"]

View file

@ -0,0 +1,3 @@
(meta (title "(std mutable vec)"))
@generate-docs[#:module "std mutable vec"]

3
modules/std/net.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std net)"))
@generate-docs[#:module "std net"]

View file

@ -0,0 +1,3 @@
(meta (title "(std orderedmap)"))
@generate-docs[#:module "std orderedmap"]

View file

@ -0,0 +1,3 @@
(meta (title "(std orderedset)"))
@generate-docs[#:module "std orderedset"]

3
modules/std/ports.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std ports)"))
@generate-docs[#:module "std ports"]

View file

@ -0,0 +1,3 @@
(meta (title "(std simpletest)"))
@generate-docs[#:module "std simpletest"]

3
modules/std/stopwatch.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std stopwatch)"))
@generate-docs[#:module "std stopwatch"]

View file

@ -0,0 +1,3 @@
(meta (title "(std syntax-match)"))
@generate-docs[#:module "std syntax-match"]

3
modules/std/test.sz Normal file
View file

@ -0,0 +1,3 @@
(meta (title "(std test)"))
@generate-docs[#:module "std test"]