From 551cfb83fd8f3cb88a3428c0bb6a7cbb933e4eeb Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 28 Oct 2024 02:15:06 +0100 Subject: Improved minibruijn and parser --- std/Option.bruijn | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'std/Option.bruijn') 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"]]) -- cgit v1.2.3