diff src/elab_env.sml @ 1272:56bd4a4f6e66

Some serious bug-fix work to get HTML example to compile; this includes fixing a bug with 'val' patterns in Unnest and the need for more local reduction in Especialize
author Adam Chlipala <adamc@hcoop.net>
date Thu, 03 Jun 2010 13:04:37 -0400
parents c316ca3c9ec6
children b4480a56cab7
line wrap: on
line diff
--- a/src/elab_env.sml	Tue Jun 01 15:46:24 2010 -0400
+++ b/src/elab_env.sml	Thu Jun 03 13:04:37 2010 -0400
@@ -1512,6 +1512,15 @@
       | PCon (_, _, _, SOME p) => patBinds env p
       | PRecord xps => foldl (fn ((_, p, _), env) => patBinds env p) env xps
 
+fun patBindsN (p, _) =
+    case p of
+        PWild => 0
+      | PVar _ => 1
+      | PPrim _ => 0
+      | PCon (_, _, _, NONE) => 0
+      | PCon (_, _, _, SOME p) => patBindsN p
+      | PRecord xps => foldl (fn ((_, p, _), n) => patBindsN p + n) 0 xps
+
 fun edeclBinds env (d, loc) =
     case d of
         EDVal (p, _, _) => patBinds env p