diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-04-21 14:06:03 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-04-21 14:06:03 -0400 |
commit | 724a2c18360626b29c99a274c2aa0c59caafeeb6 (patch) | |
tree | 2100357cdeef6343ac689fdd9dc9543a56cb471d | |
parent | 9b19f308a34b54866e7cc4203dc8e4876b07d5ae (diff) |
Add another rule to simplify record concatenations for pretty-printing
-rw-r--r-- | src/elab_ops.sml | 3 | ||||
-rw-r--r-- | tests/simplify.ur | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/elab_ops.sml b/src/elab_ops.sml index dbefbe7d..1546feef 100644 --- a/src/elab_ops.sml +++ b/src/elab_ops.sml @@ -1,4 +1,4 @@ -(* Copyright (c) 2008, Adam Chlipala +(* Copyright (c) 2008, 2012, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -482,6 +482,7 @@ fun reduceCon env (cAll as (c, loc)) = | ((CRecord (_, []), _), _) => c2 | ((CConcat (c11, c12), loc), _) => reduceCon env (CConcat (c11, (CConcat (c12, c2), loc)), loc) | (_, (CRecord (_, []), _)) => c1 + | ((CRecord (k, xcs1), loc), (CConcat ((CRecord (_, xcs2), _), c2'), _)) => (CConcat ((CRecord (k, xcs1 @ xcs2), loc), c2'), loc) | _ => (CConcat (c1, c2), loc) end | CMap _ => cAll diff --git a/tests/simplify.ur b/tests/simplify.ur new file mode 100644 index 00000000..11e002eb --- /dev/null +++ b/tests/simplify.ur @@ -0,0 +1 @@ +fun main [r] (r : $([A = int] ++ ([B = float] ++ r))) : $([A = float] ++ ([B = int] ++ r)) = r |