alux-shape-term
alux-shape-term interprets an alux-shape term as the term itself, so a shape can
be written down and read back.
use ;
use ;
let alg = TermShape;
let display_name = alg.field;
let written = alg.named_product;
// The written term is a value, so it travels as one.
let document = to_string.expect;
let read: Term = from_str.expect;
assert_eq!;
Every other interpretation answers with something that is not a shape — text, a judgement, a declaration in another language. This one answers with the shape, which is what lets a term leave the host that stated it: written here, read there, and folded into whichever algebra that host carries.
Term::fold is the reader. Folding a written term with any interpretation answers what interpreting
the original directly would, which is the law this crate is checked by — and the reason a host needs
only a writer and a reader rather than one adapter per pair of hosts.