Open jongleb opened 1 month ago
didn't look at the code
:: Type?
here?why is :: Type? here?
Just shortcut Remove?
So it means if A? OR B? and both are None - then condition is true and everything is selected.
Yes, something like with COALESCE
(maybe a bad analogy), while the first is not null - type is always null
What is expected usage ratio for A! and A? One obviously can be expressed with the other (or via current manual unwrapping), so if one is very low use - i would prefer to not introduce extra syntax.
Ok I'll remove it
ok, so keep this PR only about introducing automatic elimination for A? OR B?
I am also slightly uneasy about ::Type?
precisely because it means different thing from WHERE A?
which may be possibly confusing? Maybe it is worth to be more explicit with :: Maybe Type or some such or maybe I am overthinking
This PR adds new syntaxes:
1)
@param :: Type?
2)WHERE A? AND B? OR C? which is a shortcut to WHERE @choice { None { TRUE } | Some (params) { A } } AND etc
3)WHERE A! AND B! OR C! which expands to WHERE @choice { None { FALSE } | Some { A } } AND etc
And considers
join_cond
as not null by the defaultExample:
DDL:
SQL:
will be generated the following code:
Also, it differs from the regular
Choice
in that, in this case, not a polymorphic variant is generated because for this case, it would lead to the useless matching from the regularoption
type to the poly version of the option in the user code.