5 releases
0.1.1 | Sep 28, 2023 |
---|---|
0.1.0 | Sep 28, 2023 |
0.0.3 | Nov 28, 2022 |
0.0.2 | Nov 28, 2022 |
0.0.1 | Nov 18, 2022 |
#25 in #solid
70 downloads per month
Used in 19 crates
(12 directly)
33KB
879 lines
gdp_rs
This crate provides utilities to employ Ghosts-of-Departed-Proofs pattern in rust projects. This enables type drive development following Parse, don't validate principle.
The idea is that, instead of checking or validating the values of a Type for satisfying certain properties, one create a wrapper refined new type that can only constructed from the values satisfying desired predicates. Thus, one can centralize the validation mechanism, and use typesystem to enforce right invariant.
This crate provides a type Proven
, which is generic over the predicate type.
It can be instantiated only from valid subject values of a type, satisfying the
predicate function.
The crate also provides combinatrics over multiple predicates, so that one compose a compound predicate type from list of other predicate type.
License: MIT OR Apache-2.0
Dependencies
~0.4–1MB
~20K SLoC