diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-11-11 19:20:37 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-11-11 19:20:37 -0500 |
commit | 887af944c67e3395679a750a205ef114234c61a0 (patch) | |
tree | 99c1c46f59df9c378621aa8d05b072d50a81698e /src/reduce.sml | |
parent | f3e4bff668d3be5fcc7a2f6d04b7d9efb8f10624 (diff) |
Add CutMulti
Diffstat (limited to 'src/reduce.sml')
-rw-r--r-- | src/reduce.sml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/reduce.sml b/src/reduce.sml index 1404b598..e480dea2 100644 --- a/src/reduce.sml +++ b/src/reduce.sml @@ -133,6 +133,19 @@ fun exp env e = in #1 (reduceExp env (ERecord (fields (xts, [])), loc)) end + | ECutMulti (r as (_, loc), _, {rest = (CRecord (k, xts), _), ...}) => + let + fun fields (remaining, passed) = + case remaining of + [] => [] + | (x, t) :: rest => + (x, + (EField (r, x, {field = t, + rest = (CRecord (k, List.revAppend (passed, rest)), loc)}), loc), + t) :: fields (rest, (x, t) :: passed) + in + #1 (reduceExp env (ERecord (fields (xts, [])), loc)) + end | _ => e in |