"failed" has Ring gives error

2 views
Skip to first unread message

Qian Yun

unread,
Apr 23, 2026, 9:26:02 AM (2 days ago) Apr 23
to fricas-devel
(1) -> "failed" has Type

(1) true
Type: Boolean
(2) -> "failed" has Ring

>> System error:
The value
#\e
is not of type
LIST

(2) -> 1 has Ring

1 is not a valid type.


As shown above, the singleton types can't do some
"has" operation.

- Qian

Ralf Hemmecke

unread,
Apr 23, 2026, 10:09:35 AM (2 days ago) Apr 23
to fricas...@googlegroups.com
Honestly, I don't like a type with the name "failed".
I would be happier, if we do it as in Aldor, i.e. create a type, like
Partial, with the respective exports.

https://github.com/aldorlang/aldor/blob/master/aldor/lib/aldor/src/base/sal_partial.as#L46

At least introducing Partial, could help to slowly fade out
Union(X,"failed") and eventually replace it by Partial(X).

That this will not happen soon, is clear, but "failed" as a Type looks
really bad to me, since it is too easily confused with a string.

Opinions?

Ralf

Qian Yun

unread,
6:12 PM (2 minutes ago) 6:12 PM
to fricas...@googlegroups.com
+1 for this.

We had a very long discussion about this a few years ago.

One of the results from that discussion, about the advantage
of current Union("failed", xx) is that, there's compiler
support for "failed", so for the other branch, type coercion
is automated, (no need to manually coerce value to type xx).

But I think this is only a small advantage.

- Qian

On 4/23/26 10:09 PM, 'Ralf Hemmecke' via FriCAS - computer algebra
Reply all
Reply to author
Forward
0 new messages