At present, numbers and strings are patterns, but true and false are not. Should they be?
Uniformity suggest yes. Practicality suggest no. Why the latter? Well, that would give meaning to
false — the pattern that matches the boolean false (rather than than pattern that matches nothing, which is None)
true — the pattern that matches the boolean true (rather than than pattern that matches anything, which is Unknown, or Done)
‹bool1› | ‹bool2› — the pattern that matches anything matched by ‹bool1› or by ‹bool2›
‹bool1› & ‹bool2› — the pattern that matches anything matched by ‹bool1› and by ‹bool2›
So, for example, true & false will match nothing, while true && false will match false ... I think. In any case, this would create plenty of room for confusion.
At present, numbers and strings are patterns, but
true
andfalse
are not. Should they be?Uniformity suggest yes. Practicality suggest no. Why the latter? Well, that would give meaning to
false
— the pattern that matches the boolean false (rather than than pattern that matches nothing, which isNone
)true
— the pattern that matches the boolean true (rather than than pattern that matches anything, which isUnknown
, orDone
)So, for example,
true & false
will match nothing, whiletrue && false
will match false ... I think. In any case, this would create plenty of room for confusion.