On 4/26/26 06:26, Qian Yun wrote:
> On 4/26/26 7:43 AM, Waldek Hebisch wrote:
>>
>> IMO, replacemnet of general purpose things by special cases
>> shuld happen only when there is significant gain from the
>> special case.
I like your conservativeness. I was not asking to remove
Union(X,"failed") immediately. Just asking to also have Partial.
> Not a significant gain, but Haskell's Maybe is a higher
> abstraction, allows map and composition (>>=).
I actually don't care about composition. That would only be a
nice-to-have. In fact, I not even like autocoercion in the compiler for
the Union(X,"failed") type. Would that coercion also work reliably for
"reject" instead of "failed", or ist "failed" as builtin SPAD type?
Why is this "failed" as a type not called Failed, with its only element
"failed", or rather failed (without the quotes)?
Concerning X2==Union(X, "failed", "reject")... Admittedly, introducing
Partial would not help with modelling a type that is a union of 3 types.
On the other hand, X2 can also be modelled by a union of X with a
two-element type.
I will not fight here for anything. It's not very high priority for me.
>> Concerning confusion, we have overloading and that IMO is
>> more confusing than "failed". Yet people cope quite well
>> with that.
Not quite my point. It is just that "failed" (as a type name) does not
fit the convention that types start with a capital letter. And it rather
looks like a string. (It is actually a similar thing like writing
"+": (%, %) -> %
instead of just
+: (%, %) -> %
Things that aren't strings should not be denoted like strings.
It's more aboutl aesthetics than not being able to interpret that stuff.
Ralf