Expand description
formality-core
contains core definitions that can be used for
languages that are not Rust. It is intended to play a role similar
to
Modules§
- binder
- Manages binders so that the main rules can be nice and simple.
- fixed_
point - fold
- instrument
- Attach a span to a
std::future::Future
. - judgment
- language
- parse
- substitution
- term
- variable
- visit
Macros§
- bail
- Return early with an error.
- cast_
impl - debug
- Constructs an event at the debug level.
- declare_
language - Declares a new formality language.
This will generate a module with a name you choose that contains various items;
among them will be a struct named
FormalityLang
that implements theLanguage
trait. When you use the auto-derives or theterm
macro, they will generate code that referencescrate::FormalityLang
, so you need to bring that in scope at the root of your crate (e.g., if you called the modulemylang
, you might adduse crate::mylang::FormalityLang
at the root of your crate, so that the auto-derives can find it.) - id
- Declares a newtyped struct that is an arbitrary (string) identifier, like the name of a module or something.
- judgment_
fn - push_
rules - push_rules! allows construction of inference rules using a more logic-like notation.
- seq
- Replacement for the
vec
macro that supports..foo
notation to flatten vectors. - set
- trace
- Constructs an event at the trace level.
- trait_
alias
Traits§
- Deduplicate
- Downcast
- This is the convenience trait whose method you should call to do a downcast.
- Downcast
From - Our version of “try-from”. A “downcast” casts from a more general type (e.g., any Parameter) to a more specific type (e.g., a type). This returns an Option because the value may not be an instance of the more specific type.
- Downcast
To - Our version of “try-into”. A “downcast” casts from a more general type (e.g., any Parameter) to a more specific type (e.g., a type).
- Downcasted
- SetExt
- To
- Upcast
- Our version of
Into
. This is the trait you use in where clauses, but you typically implementUpcastFrom
. - Upcast
From - Our version of
From
. One twist: it is implemented for &T for all T. This is the trait you implement. - Upcasted
Functions§
- with_
tracing_ logs - Run an action with a tracing log subscriber. The logging level is loaded
from
RUST_LOG
. Theformality_macro::test
expansion uses this to enable logs.
Type Aliases§
Attribute Macros§
- fixed_
point - instrument
- Instruments a function to create and enter a
tracing
span every time the function is called. - requires
- Pre-conditions are checked before the function body is run.
- term
- test