Expand description
Partial is similar to Option where Value replaces Some and Nothing replaces None.
Similarly to Value, Fake contains a value of the right type that can be further used (e.g. in map or and_then) but this value is a dummy value used to be able to compute the rest and detect more errors. For any method, we have the ordering: Value > Fake > Nothing; a Fake value will never be a Value again.
Use case: When compiling, an error in one function must be reported but should not prevent the compilation of a second function to detect more errors in one run. This intermediate state is represented by Fake.
Re-exports§
pub use environment::*;
Modules§
- environment
Environmentis constituted of a state namedenvthat is never lost (even if the partial data is equal toNothing). It behaves similarly toPartialbut the binders (e.g.and_then) take two parameters: the environment and the unwrapped partial data. This structure is useful to implement compiler whereenvcontains the configuration anddatathe compilation context.