On 20 ????? 2016, at 14:54, Jesse Schalken <m...@jesseschalken.com<mailto:m...@jesseschalken.com>> wrote:
If I had "scalar", "number" and ?T as types, the types I would need would be: 1. ?scalar|Decimal What's decimal? I'm not aware we have that type. Apologies if I missed it that it was added. 1. ?scalar|Decimal|Expr What's Expr? Again I'm not aware that we have that type. In both, a nullable scalar does the job. 1. ?scalar|array Conduct this check in user code, you'd have to anyway. 1. int|string (I want int|string here. I know array keys are always int|string. A wider type is lies.) This is needlessly purist. For handling a meaningless con, we'd overcomplicate the language and provide a footgun(tm) for everyone. Not a good bargain. 1. ?scalar (probably) Ok 1. number Ok 1. T|false You didn't answer my question on this one. 1. ?T Ok 5 out of 8 still need a union. Actually, in my count only one of them does (#7) and it's probably solvable (if it's even a thing), and in another, it makes no sense to use types at all (#3) as you'd have to do these checks in userland anyway. All others can be satisfied just fine with scalar, numeric and nullable types, unless you're being needlessly purist - and we're not going to overcomplicate the language for the sake of purism. Zeev