A few things come to mind: 1) It's a little unlikely that at the same time you have data where an {} is an error, but you are not making the property required AND with knowledge of that you still don't bother with other…
This type of error is better remedied by making the balance property be required (so that it cannot be set to {} and produce an exception at the time the error is introduced). This way you will know about the error…
Oh, that's simple: sum(A UNION B) should be the same as sum(A) + sum(B) for any two sets A and B (or else there would be very weird inconsistencies). sum(A UNION {}) = sum(A) + sum({}) sum(A) = sum(A) + sum({}) 0 =…
You are exactly right about everything consuming sets in EdgeDB. Even when a function is defined on scalars, it's really defined on singleton sets. Literals are also singleton sets, so "1" and "{1}" are equivalent and…
Let me make a tiny correction to the expression you wrote: "sum({1, 1, {}})" - the function sum takes only one argument and it's a set. Because we flatten all "nested" sets, the expression "{1, 1, {}}" is equivalent to…
The sum of an empty set is, in fact, 0 (the identity for addition). The generalized conjuction (we have a function called "all" for that) of an empty set is True (the identity for conjunction). The generalized…
If a NULL were just a value in 3-valued logic, it could have been OK. However, that's not how it works out. Consider the following (that should be equivalent if NULL is just like Maybe in True-Maybe-False logic): SELECT…
You seem to treat NULLs as if they have a specific meaning. So then the question is this: what should count(NULL) be? Here are some options: 1) count(NULL) = 0, so apparently NULL is just like an empty set at least some…
A few things come to mind: 1) It's a little unlikely that at the same time you have data where an {} is an error, but you are not making the property required AND with knowledge of that you still don't bother with other…
This type of error is better remedied by making the balance property be required (so that it cannot be set to {} and produce an exception at the time the error is introduced). This way you will know about the error…
Oh, that's simple: sum(A UNION B) should be the same as sum(A) + sum(B) for any two sets A and B (or else there would be very weird inconsistencies). sum(A UNION {}) = sum(A) + sum({}) sum(A) = sum(A) + sum({}) 0 =…
You are exactly right about everything consuming sets in EdgeDB. Even when a function is defined on scalars, it's really defined on singleton sets. Literals are also singleton sets, so "1" and "{1}" are equivalent and…
Let me make a tiny correction to the expression you wrote: "sum({1, 1, {}})" - the function sum takes only one argument and it's a set. Because we flatten all "nested" sets, the expression "{1, 1, {}}" is equivalent to…
The sum of an empty set is, in fact, 0 (the identity for addition). The generalized conjuction (we have a function called "all" for that) of an empty set is True (the identity for conjunction). The generalized…
If a NULL were just a value in 3-valued logic, it could have been OK. However, that's not how it works out. Consider the following (that should be equivalent if NULL is just like Maybe in True-Maybe-False logic): SELECT…
You seem to treat NULLs as if they have a specific meaning. So then the question is this: what should count(NULL) be? Here are some options: 1) count(NULL) = 0, so apparently NULL is just like an empty set at least some…