comparison src/specialize.sml @ 851:20a364c4a6dc

Fix a bug with 'Some p' patterns, where 'p' needs specialization
author Adam Chlipala <adamc@hcoop.net>
date Thu, 18 Jun 2009 18:06:15 -0400
parents 0f7e2cca6d9b
children 5b5c0b552f59
comparison
equal deleted inserted replaced
850:1c2f335297b7 851:20a364c4a6dc
187 in 187 in
188 case IM.find (cmap, pn) of 188 case IM.find (cmap, pn) of
189 NONE => raise Fail "Specialize: Missing datatype constructor (pat)" 189 NONE => raise Fail "Specialize: Missing datatype constructor (pat)"
190 | SOME pn' => ((PCon (dk, PConVar pn', [], po), #2 p), st) 190 | SOME pn' => ((PCon (dk, PConVar pn', [], po), #2 p), st)
191 end 191 end
192 end
193 | PCon (dk, pc, args, SOME p') =>
194 let
195 val (p', st) = pat (p', st)
196 in
197 ((PCon (dk, pc, args, SOME p'), #2 p), st)
192 end 198 end
193 | PCon _ => (p, st) 199 | PCon _ => (p, st)
194 | PRecord xps => 200 | PRecord xps =>
195 let 201 let
196 val (xps, st) = ListUtil.foldlMap (fn ((x, p, t), st) => 202 val (xps, st) = ListUtil.foldlMap (fn ((x, p, t), st) =>