diff src/monoize.sml @ 1690:a7b70c7b3f1a

Avoid 'not fully determined' errors for fancy tasks
author Adam Chlipala <adam@chlipala.net>
date Sat, 03 Mar 2012 16:20:54 -0500
parents ac141fbb313a
children 78ea155b6b14
line wrap: on
line diff
--- a/src/monoize.sml	Sat Mar 03 15:47:52 2012 -0500
+++ b/src/monoize.sml	Sat Mar 03 16:20:54 2012 -0500
@@ -4115,6 +4115,20 @@
             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,