comparison src/mono_reduce.sml @ 188:8e9f97508f0d

Datatype representation optimization
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 Aug 2008 19:49:21 -0400
parents 19ee24bffbc0
children 7e9bd70ad3ce
comparison
equal deleted inserted replaced
187:fb6ed259f5bd 188:8e9f97508f0d
77 if Prim.equal (p, p') then 77 if Prim.equal (p, p') then
78 SOME env 78 SOME env
79 else 79 else
80 NONE 80 NONE
81 81
82 | (PCon (PConVar n1, NONE), ECon (PConVar n2, NONE)) => 82 | (PCon (_, PConVar n1, NONE), ECon (_, PConVar n2, NONE)) =>
83 if n1 = n2 then 83 if n1 = n2 then
84 SOME env 84 SOME env
85 else 85 else
86 NONE 86 NONE
87 87
88 | (PCon (PConVar n1, SOME p), ECon (PConVar n2, SOME e)) => 88 | (PCon (_, PConVar n1, SOME p), ECon (_, PConVar n2, SOME e)) =>
89 if n1 = n2 then 89 if n1 = n2 then
90 match (env, p, e) 90 match (env, p, e)
91 else 91 else
92 NONE 92 NONE
93 93
94 | (PCon (PConFfi {mod = m1, con = con1, ...}, NONE), ECon (PConFfi {mod = m2, con = con2, ...}, NONE)) => 94 | (PCon (_, PConFfi {mod = m1, con = con1, ...}, NONE), ECon (_, PConFfi {mod = m2, con = con2, ...}, NONE)) =>
95 if m1 = m2 andalso con1 = con2 then 95 if m1 = m2 andalso con1 = con2 then
96 SOME env 96 SOME env
97 else 97 else
98 NONE 98 NONE
99 99
100 | (PCon (PConFfi {mod = m1, con = con1, ...}, SOME ep), ECon (PConFfi {mod = m2, con = con2, ...}, SOME e)) => 100 | (PCon (_, PConFfi {mod = m1, con = con1, ...}, SOME ep), ECon (_, PConFfi {mod = m2, con = con2, ...}, SOME e)) =>
101 if m1 = m2 andalso con1 = con2 then 101 if m1 = m2 andalso con1 = con2 then
102 match (env, p, e) 102 match (env, p, e)
103 else 103 else
104 NONE 104 NONE
105 105