diff --git a/preserves-schema.md b/preserves-schema.md index 9194f48..f32a696 100644 --- a/preserves-schema.md +++ b/preserves-schema.md @@ -182,16 +182,15 @@ Intersections are an experimental feature. They can be used to express *optional dictionary entries*:[^not-ideal-optional-encoding] MyDict = {a: int, b: string} & @c MaybeC . - MaybeC = @present {c: symbol} / @absent {} . + MaybeC = @present {c: symbol} / @invalid {c: any} / @absent {} . It is not yet clear whether they pull their weight. In particular, the semantics of serializing a value defined by intersection are not completely clear. -[^not-ideal-optional-encoding]: This encoding is not ideal. Given a - term `{a: 1, b: "", c: sym}`, it will yield a `present` result, - and given `{a: 1, b: ""}`, will yield an `absent` result; but - `absent` will also result from `{a: 1, b: "", c: "notasymbol"}`. +[^not-ideal-optional-encoding]: This encoding is not ideal. It passes + responsibility for checking for invalid inputs up to the user, + rather than handling it completely at the Schema layer. ### Patterns.