Crate partial [] [src]

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.


pub use environment::*;



Environment is constituted of a state named env that is never lost (even if the partial data is equal to Nothing). It behaves similarly to Partial but the binders (e.g. and_then) take two parameters: the environment and the unwrapped partial data. This structure is useful to implement compiler where env contains the configuration and data the compilation context.