aboutsummaryrefslogtreecommitdiffhomepage
path: root/std/Option.bruijn
diff options
context:
space:
mode:
authorMarvin Borner2024-10-28 02:15:06 +0100
committerMarvin Borner2024-10-28 02:15:06 +0100
commit551cfb83fd8f3cb88a3428c0bb6a7cbb933e4eeb (patch)
tree46878796fafecb5d6d866a30948761efc97f0d96 /std/Option.bruijn
parentfe1fe57f358472561041cde12a48d28b8bd247a9 (diff)
Improved minibruijn and parser
Diffstat (limited to 'std/Option.bruijn')
-rw-r--r--std/Option.bruijn5
1 files changed, 5 insertions, 0 deletions
diff --git a/std/Option.bruijn b/std/Option.bruijn
index 3b1c0a1..a6323d2 100644
--- a/std/Option.bruijn
+++ b/std/Option.bruijn
@@ -45,3 +45,8 @@ apply [[1 none 0]] ⧗ (Option a) → (a → b) → c
:test (apply none [some ([[1]] 0)]) (none)
:test (apply (some [[0]]) [some ([[1]] 0)]) (some [[[0]]])
+
+result-or [[0 [[0 3]] [[[1 2]]]]]
+
+:test (result-or "fail" none) ([[0 "fail"]])
+:test (result-or "fail" (some "ok")) ([[1 "ok"]])