crow/result.crow
(source)
result
[ok
, error
] union
ok
ok
error
error
A result
is either a success (ok
) or failure (error
) value.
This provides a more explicit alternative to throwing an exception.
Prefer this over throwing an exception if failure is likely.
==
[t
, u
] bool
(a
(t
, u
) result
, b
(t
, u
) result
) t
equal
, u
equal
equal
equal