summaryrefslogtreecommitdiff
path: root/common.sml
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2025-05-19 21:17:49 +0200
committerVladimir Azarov <avm@intermediate-node.net>2025-05-19 21:17:49 +0200
commitb2d8dcd8673cfcdbf1e8a02aa19c53e42b8a60b6 (patch)
tree7de178aec8ebeacc7b4effe3b09de4485487da65 /common.sml
parent88378509521b46e615986f8c82d10b9da88830d2 (diff)
Transition from exception-based errors to printf-based
Diffstat (limited to 'common.sml')
-rw-r--r--common.sml3
1 files changed, 3 insertions, 0 deletions
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