Module prelude

Module prelude 

Source
Expand description

The standard library of the walking skeleton.

Small on purpose. §3.2’s promise is that “effect polymorphism is what keeps one standard library” — map : (list[a], (a -> b ! e)) -> list[b] ! e. Phase 2 has effect rows, so that signature is now written as written: map_list is polymorphic in what its function argument does, and mapping an effectful function over a list is effectful in exactly that way. One library, one definition per operation, usable from any tier the placement solver allows.

The rows here are the source of truth for inference. Prim::effects is the same information for the atoms a primitive performs itself, and a test holds the two in agreement.

Everything here is a Prim, which means the evaluator implements it and the eventual Cranelift/LLVM backends implement it — never a Beck-source shim that would have to be compiled twice.

Constants§

NUM
The trait +, -, * and / resolve through.

Functions§

builtin_arity
The type-constructor arities the checker knows without a declaration.
num_method
Which method of NUM an operator is.
prims
Every primitive’s name and type.
traits
The traits every program has.
types
Types every program has: Option, Result, Envelope, Session, Proposal.