On 2/24/21 9:48 PM, Ralf Hemmecke wrote:
I'm almost sure that "Maybe" doesn't need special Haskell
compiler treatment, a user implemented "Maybe" can achieve
similar performance. Because "Maybe" is such a simple
structure, the compiler can optimize it right away, no
need to special treat it at all.
Apart from such optimizations... why do you want Maybe instead of Partial?
I'm not promoting "Maybe" over "Partial".
As you said bellow, I'm not discussing about naming right now,
but to let everyone agree to move away from "failed"
to "this functional style error handling".
Thanks for your interest in my proposal.
- Qian
(in axllib)
https://github.com/pippijn/aldor/blob/master/aldor/lib/axllib/src/al/partial.as
(or a bit more extended in the libaldor)
https://github.com/pippijn/aldor/blob/master/aldor/lib/aldor/src/base/sal_partial.as
Wouldn't that just be a question of naming?
I somehow would like failed?(x) better than isNothing(x) or isJust(x).
Anyway, I also like Partial/Maybe better than Union(X,"failed").
The Union(X,"failed") stuff is quite common in the FriCAS algebra
library. It doesn't mean that one must replace Union(X, "error1",
"error2") where two error cases are considered. But introducing
Partial/Mabe could produce more readable code and would certainly make
translating SPAD code to Aldor easier.
Ralf
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/40fa59b3-c06a-999b-34ca-83bf26aca03d%40gmail.com.