We currently have several layers that implicate the std::option::Option type for the ValueType of Formats, specifically around the Format::Maybe type. However, it is not currently possible to work with this
as a first-class type in the model.
In the above example, we are forced to construct a monomorphic microcosm of the Option type instead of being able to access it natively. Along with the inconvenience of this workaround, we also lose the convenient API of the
Option type in generated code.
We also lack Value::Option (and ParsedValue::Option), Pattern::Some(Box<Pattern>) and Pattern::None, as well as other, possibly obscure locations where a first-class Option model would be useful/convenient.
First-Class Option-model (
simple
,narrow
,cons
)We currently have several layers that implicate the
std::option::Option
type for theValueType
ofFormats
, specifically around theFormat::Maybe
type. However, it is not currently possible to work with this as a first-class type in the model.Example: deflate.rs
In the above example, we are forced to construct a monomorphic microcosm of the Option type instead of being able to access it natively. Along with the inconvenience of this workaround, we also lose the convenient API of the Option type in generated code.
We also lack
Value::Option
(andParsedValue::Option
),Pattern::Some(Box<Pattern>)
andPattern::None
, as well as other, possibly obscure locations where a first-classOption
model would be useful/convenient.