1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
#![no_std]
/*!
Mononym is a library for creating unique type-level names for each value
in Rust. The core type `Named<Name, T>` represents a named value of type
`T` with a unique type `Name` as its name. Mononym guarantees that there
can be no two values with the same name. With that, the `Name` type
serves as a unique representation of a Rust value at the type level.
Mononym enables the use of the design pattern
[Ghosts of Departed Proofs](https://kataskeue.com/gdp.pdf) in Rust.
It provides macros that simplify the definition of
[dependent pairs](https://docs.idris-lang.org/en/latest/tutorial/typesfuns.html#dependent-pairs)
and proof objects in Rust. Although there is still limited support for
a full dependently-typed programming in Rust, Mononym helps us move a
small step toward that direction by making it possible to refer to
values in types.
See [`docs::implementation`] for how `mononym` implements unique name
generation in Rust.
*/
/**
The main implementation for named data types.
*/
pub mod named;
pub mod proof;
#[doc(hidden)]
pub mod macros;
pub use named::{
with_seed,
HasType,
Life,
Name,
Named,
Seed,
};
#[cfg(doc)]
pub mod docs
{
/*!
This is a rustdoc-only module providing in depth documentation
on the library.
*/
pub mod implementation
{
#![doc = include_str!("../docs/implementation.md")]
}
}
#[cfg(test)]
extern crate alloc;
#[cfg(test)]
mod test;