Actions
Feature #56
openMore dot operators
Feature #56:
More dot operators
Status:
New
Priority:
Low
Assignee:
-
Category:
Libraries
Target version:
-
Start date:
Due date:
% Done:
0%
Estimated time:
Platform:
Resolution:
Triage Stage:
Description
I am enamoured with the Anubis overloaded dot operator.
I believe the Anubis 'Kleisli applicator' or 'Maybe monad' syntax is the less intrusive one i have ever seen. It encourages a really elegant exceptionless style, so i just beg more in the same vein.
public define $A -> $C
$B -> $C g.$A -> $B f
=
($A x) |-> g(f(x)).
public define Maybe($U)
(Maybe($T),Maybe($T)) ab.($T,$T) -> Maybe($U) f
=
if ab is (a,b) then
if a is
{
failure then failure,
success(a1) then
if b is
{
failure then failure,
success(b1) then f(a1,b1)
}
}.
public define Result($E,$U)
(Result($E,$T),Result($E,$T)) ab.($T,$T) -> Result($E,$U) f
=
if ab is (a,b) then
if a is
{
error(e) then error(e),
ok(a1) then
if b is
{
error(e) then error(e),
ok(b1) then f(a1,b1)
}
}.
Actions