From b2d8dcd8673cfcdbf1e8a02aa19c53e42b8a60b6 Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Mon, 19 May 2025 21:17:49 +0200 Subject: Transition from exception-based errors to printf-based --- common.sml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common.sml') diff --git a/common.sml b/common.sml index 31a9940..f2020e2 100644 --- a/common.sml +++ b/common.sml @@ -36,6 +36,7 @@ structure Fold = struct fun step0 h (a, f) = fold (h a, f) fun step1 h (a, f) b = fold (h (b, a), f) fun step2 h (a, f) b c = fold (h (b, c, a), f) + fun step3 h (a, f) b c d = fold (h (b, c, d, a), f) end structure FRU = struct @@ -128,6 +129,8 @@ in (ifF ign (fn () => f output); (ign, output))) z fun A1 z = Fold.step2 (fn (f, v, (ign, output)) => (ifF ign (fn () => f (output, v)); (ign, output))) z + fun A2 z = Fold.step3 (fn (f, v1, v2, (ign, output)) => + (ifF ign (fn () => f (output, v1, v2)); (ign, output))) z end fun Ign z = Fold.step0 (fn (_, output) => (true, output)) z -- cgit v1.2.3