Skip to main content

Module ops

Module ops 

Source
Expand description

Operators, and applying operations to every outcome of a distribution.

Structs§

Condition
How likely a condition is to hold (docs/semantics.md, section 3).

Enums§

Truth
A fact, or a distribution of facts.

Functions§

article
as_index
binary
boolean_law
The boolean law requested by an observed anonymous draw.
combine
Gather the results of applying an operation to each outcome of some distributions into a distribution. Results that are themselves distributions are mixed in. The result is always a distribution, even when only one outcome is possible.
compare
Ordering for <, > and friends.
condition
contains
Whether item is in coll (for in).
enum_value
equals
The language’s ==: numbers compare by value across int, float and prob.
fact
field
index
index_plain
integer
Checked integer context: preserve ints, convert exactly integral finite floats, and never round or admit other numeric types implicitly.
is_certain
Is v certainly truth? (For and/or whose right side has statements.)
lift1
Apply f to a value, or to every outcome of a distribution.
lift2
Apply f to two values; distributions are independent draws.
lift_n
Apply f to a list of values, lifting over any that are distributions.
logic
Compose independent boolean recipes. Bound facts retain their identity.
make_prob
Explicit, checked construction. This never draws, lifts or clamps.
make_record
not
outcomes
The outcomes of a value: those of a distribution, or the value itself.
range_count
Bounded materialization count, never truncating a large length.
range_len
The number of integers in lo..=hi, without overflowing.
to_prob
A value used as a probability (chance weights, bernoulli, binomial…): a prob or a number checked at this boundary. Booleans need prob(b).
truth
The operand of and, or or not (docs/semantics.md, section 2).
unary
with_fields

Type Aliases§

NaryFn
A function lifted by lift_n; it may need the budget itself (to build distributions).