comparison 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
comparison
equal deleted inserted replaced
324:b91480c9a729 325:e457d8972ff1
54 ENamed xn' => 54 ENamed xn' =>
55 if xn' = xn then 55 if xn' = xn then
56 rep 56 rep
57 else 57 else
58 e 58 e
59 | ECApp (e, _) => #1 e 59 | ECApp (e', _) =>
60 let
61 fun isTheOne (e, _) =
62 case e of
63 ENamed xn' => xn' = xn
64 | ECApp (e, _) => isTheOne e
65 | _ => false
66 in
67 if isTheOne e' then
68 #1 e'
69 else
70 e
71 end
60 | _ => e} 72 | _ => e}
61 73
62 type state = { 74 type state = {
63 funcs : (kind list * (string * int * con * exp * string) list) IM.map, 75 funcs : (kind list * (string * int * con * exp * string) list) IM.map,
64 decls : decl list, 76 decls : decl list,
108 end 120 end
109 | (_, _, []) => 121 | (_, _, []) =>
110 let 122 let
111 val e = foldl (fn ((_, n, n_old, _, _, _), e) => 123 val e = foldl (fn ((_, n, n_old, _, _, _), e) =>
112 unpolyNamed (n_old, ENamed n) e) 124 unpolyNamed (n_old, ENamed n) e)
113 e vis 125 e vis
114 in 126 in
115 SOME (t, e) 127 SOME (t, e)
116 end 128 end
117 | _ => NONE 129 | _ => NONE
118 in 130 in