Mercurial > urweb
comparison src/reduce.sml @ 807:61a1f5c5ae2c
Mutual datatypes through Effectize
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 16 May 2009 15:45:12 -0400 |
parents | 8688e01ae469 |
children | 669ac5e9a69e |
comparison
equal
deleted
inserted
replaced
806:0e554bfd6d6a | 807:61a1f5c5ae2c |
---|---|
440 val c = con namedC [] c | 440 val c = con namedC [] c |
441 in | 441 in |
442 ((DCon (x, n, k, c), loc), | 442 ((DCon (x, n, k, c), loc), |
443 (IM.insert (namedC, n, c), namedE)) | 443 (IM.insert (namedC, n, c), namedE)) |
444 end | 444 end |
445 | DDatatype (x, n, ps, cs) => | 445 | DDatatype dts => |
446 let | 446 ((DDatatype (map (fn (x, n, ps, cs) => |
447 val env = map (fn _ => UnknownC) ps | 447 let |
448 in | 448 val env = map (fn _ => UnknownC) ps |
449 ((DDatatype (x, n, ps, map (fn (x, n, co) => (x, n, Option.map (con namedC env) co)) cs), loc), | 449 in |
450 st) | 450 (x, n, ps, map (fn (x, n, co) => (x, n, Option.map (con namedC env) co)) cs) |
451 end | 451 end) dts), loc), |
452 st) | |
452 | DVal (x, n, t, e, s) => | 453 | DVal (x, n, t, e, s) => |
453 let | 454 let |
454 val t = con namedC [] t | 455 val t = con namedC [] t |
455 val e = exp (namedC, namedE) [] e | 456 val e = exp (namedC, namedE) [] e |
456 in | 457 in |