Skip to main content

panproto_expr/
lib.rs

1//! # panproto-expr
2//!
3//! A pure functional expression language for panproto enriched theories.
4//!
5//! This crate provides the computational substrate for schema transforms:
6//! coercion functions, merge/split logic, default value computation,
7//! and conflict resolution policies. Expressions are:
8//!
9//! - **Pure**: no IO, no mutable state, no randomness
10//! - **Deterministic**: same inputs always produce the same output
11//! - **Serializable**: the [`Expr`] enum derives `Serialize`/`Deserialize`
12//! - **Platform-independent**: evaluates identically on native and WASM
13//! - **Bounded**: step and depth limits prevent runaway computation
14//!
15//! The language is lambda calculus with pattern matching, records, lists,
16//! and ~50 built-in operations on strings, numbers, and collections.
17
18mod builtin;
19mod env;
20mod error;
21mod eval;
22mod expr;
23mod literal;
24mod subst;
25pub mod typecheck;
26
27pub use builtin::apply_builtin;
28pub use env::Env;
29pub use error::ExprError;
30pub use eval::{EvalConfig, eval};
31pub use expr::{BuiltinOp, Expr, ExprType, Pattern};
32pub use literal::Literal;
33pub use subst::{free_vars, pattern_vars, substitute};