diff src/reduce.sml @ 1240:beb67ff4c8a0

'also' policies and policy reduction; calendar in good shape
author Adam Chlipala <adamc@hcoop.net>
date Thu, 15 Apr 2010 10:00:30 -0400
parents c316ca3c9ec6
children 56bd4a4f6e66
line wrap: on
line diff
--- a/src/reduce.sml	Thu Apr 15 08:48:41 2010 -0400
+++ b/src/reduce.sml	Thu Apr 15 10:00:30 2010 -0400
@@ -668,14 +668,23 @@
                                       exp = fn (_, n) => n + 1} 0
 
         fun mayInline (polyC, n, t, e) =
-            case IM.find (uses, n) of
-                NONE => false
-              | SOME count => count <= 1
-                              orelse (case #1 e of
-                                          ERecord _ => true
-                                        | _ => false)
-                              orelse isPoly polyC t
-                              orelse size e <= Settings.getCoreInline ()
+            let
+                fun isPolicy t =
+                    case #1 t of
+                        CFfi ("Basis", "sql_policy") => true
+                      | TFun (_, t) => isPolicy t
+                      | _ => false
+            in
+                case IM.find (uses, n) of
+                    NONE => false
+                  | SOME count => count <= 1
+                                  orelse (case #1 e of
+                                              ERecord _ => true
+                                            | _ => false)
+                                  orelse isPolicy t
+                                  orelse isPoly polyC t
+                                  orelse size e <= Settings.getCoreInline ()
+            end
 
         fun doDecl (d as (_, loc), st as (polyC, namedC, namedE)) =
             case #1 d of