diff src/unpoly.sml @ 325:e457d8972ff1

Crud listing IDs
author Adam Chlipala <adamc@hcoop.net>
date Thu, 11 Sep 2008 17:41:52 -0400
parents 04ebfe929a98
children 2d64457eedb1
line wrap: on
line diff
--- a/src/unpoly.sml	Thu Sep 11 13:06:51 2008 -0400
+++ b/src/unpoly.sml	Thu Sep 11 17:41:52 2008 -0400
@@ -56,7 +56,19 @@
                                 rep
                             else
                                 e
-                          | ECApp (e, _) => #1 e
+                          | ECApp (e', _) =>
+                            let
+                                fun isTheOne (e, _) =
+                                    case e of
+                                        ENamed xn' => xn' = xn
+                                      | ECApp (e, _) => isTheOne e
+                                      | _ => false
+                            in
+                                if isTheOne e' then
+                                    #1 e'
+                                else
+                                    e
+                            end
                           | _ => e}
 
 type state = {
@@ -110,7 +122,7 @@
                                         let
                                             val e = foldl (fn ((_, n, n_old, _, _, _), e) =>
                                                               unpolyNamed (n_old, ENamed n) e)
-                                                    e vis
+                                                          e vis
                                         in
                                             SOME (t, e)
                                         end