From 0c40c8d8844bbb71999c7b5bd0bee24d24a972e0 Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Thu, 7 Aug 2025 01:14:26 +0200 Subject: Constant propagation --- common.sml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common.sml') diff --git a/common.sml b/common.sml index 72efe93..f8adede 100644 --- a/common.sml +++ b/common.sml @@ -26,6 +26,7 @@ structure FRU = struct fun f7 z = next f6 z fun f8 z = next f7 z fun f9 z = next f8 z + fun f10 z = next f9 z fun c0 from = from fun c1 from = c0 from f1 @@ -37,6 +38,7 @@ structure FRU = struct fun c7 from = c6 from f7 fun c8 from = c7 from f8 fun c9 from = c8 from f9 + fun c10 from = c9 from f10 fun makeUpdate cX (from, from', to) record = let @@ -55,6 +57,7 @@ structure FRU = struct fun makeUpdate7 z = makeUpdate c7 z fun makeUpdate8 z = makeUpdate c8 z fun makeUpdate9 z = makeUpdate c9 z + fun makeUpdate10 z = makeUpdate c10 z fun upd z = Fold.step2 (fn (s, f, (vars, ops)) => @@ -147,6 +150,8 @@ fun bindWith2str to = bind A1 (fn v => fn (output, _) => output $ to v) fun F z = bind A0 (fn (_, mf) => mf ()) z val I = fn z => bindWith2str Int.toString z +fun i v out = Printf out I v % + val C = fn z => bindWith2str str z val B = fn z => bindWith2str Bool.toString z val W = fn z => bindWith2str (Word.fmt StringCvt.DEC) z -- cgit v1.2.3