diff src/mono_env.sml @ 567:1901db85acb4

Start of JsComp
author Adam Chlipala <adamc@hcoop.net>
date Sat, 20 Dec 2008 14:19:21 -0500
parents e976b187d73a
children 162d5308e34f
line wrap: on
line diff
--- a/src/mono_env.sml	Fri Dec 19 12:38:11 2008 -0500
+++ b/src/mono_env.sml	Sat Dec 20 14:19:21 2008 -0500
@@ -122,4 +122,15 @@
       | PNone _ => env
       | PSome (_, p) => patBinds env p
 
+fun patBindsN (p, loc) =
+    case p of
+        PWild => 0
+      | PVar _ => 1
+      | PPrim _ => 0
+      | PCon (_, _, NONE) => 0
+      | PCon (_, _, SOME p) => patBindsN p
+      | PRecord xps => foldl (fn ((_, p, _), count) => count + patBindsN p) 0 xps
+      | PNone _ => 0
+      | PSome (_, p) => patBindsN p
+
 end