diff options
-rw-r--r-- | src/monoize.sml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index 1331d065..d0be7449 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -4115,6 +4115,20 @@ fun monoDecl (env, fm) (all as (d, loc)) = let val (e1, fm) = monoExp (env, St.empty, fm) e1 val (e2, fm) = monoExp (env, St.empty, fm) e2 + + val un = (L'.TRecord [], loc) + val t = if MonoUtil.Exp.exists {typ = fn _ => false, + exp = fn L'.EFfiApp ("Basis", "periodic", _) => true + | _ => false} e1 then + (L'.TFfi ("Basis", "int"), loc) + else + un + + val e2 = (L'.EAbs ("$x", t, (L'.TFun (un, un), loc), + (L'.EAbs ("$y", un, un, + (L'.EApp ( + (L'.EApp (e2, (L'.ERel 1, loc)), loc), + (L'.ERel 0, loc)), loc)), loc)), loc) in SOME (env, fm, |