Skip to main content

sim_lib_pattern/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Pattern behavior for the SIM runtime over the kernel `Shape` protocol.
4//!
5//! The kernel defines the `Shape` match/binding protocol; this crate supplies
6//! the concrete pattern organ (algebraic data types, destructuring, match arms,
7//! and exhaustiveness checking) as pattern surfaces over that protocol.
8
9mod adt;
10mod claims;
11mod match_form;
12mod matching;
13mod runtime;
14mod shapes;
15
16pub use adt::{
17    AlgebraicDataType, PatternField, TaggedValue, VariantConstructor, VariantDeclaration,
18    tagged_value,
19};
20pub use claims::{
21    pattern_adt_op_key, pattern_destructure_op_key, pattern_exhaustive_op_key,
22    pattern_match_op_key, pattern_op_keys, pattern_organ_symbol, pattern_tag_op_key,
23    publish_pattern_organ_claims, publish_pattern_organ_claims_for_lib,
24};
25pub use match_form::MatchForm;
26pub use matching::{
27    MatchArm, PatternMatch, destructure_expr, destructure_value, exhaustiveness_diagnostics,
28    match_value,
29};
30pub use runtime::{PatternLib, install_pattern_lib, manifest_name, pattern_exports};
31pub use shapes::{AdtShape, VariantShape};
32
33/// Cookbook recipes for this lib, embedded at build time.
34pub static RECIPES: sim_cookbook::EmbeddedDir =
35    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
36
37#[cfg(test)]
38mod tests;