#proc-macro #sigma #safety #sigma-types-macros

macro sigma-types-macros

Macros to enhance the sigma-types crate

1 unstable release

Uses new Rust 2024

0.1.0 Jan 20, 2025

#1389 in Procedural macros

MPL-2.0 license

74KB
271 lines

Macros that expand the power and usefulness of the sigma-types crate.


Macros to enhance the sigma-types crate

Universal type safety

The #[forall] macro automatically writes a test that ensures that, for any possible inputs, a function never panics (which would indicate a broken sigma-type guarantee). This helps enforce a consistent paradigm in which any "invariants" or special caveats ought to be readable directly off an item's type signature for its end-users: if a certain input combination causes a function to fail, then it ought to be explicitly disallowed at the type level. (Internally, this uses quicheck to do most of the heavy lifting.)

Dependencies

~1.5MB
~38K SLoC