# HG changeset patch # User Adam Chlipala # Date 1335031563 14400 # Node ID dd12d6d9e9a7dcf99438f6e418204ee4b04abbdf # Parent 16ee7ff7f1198b76e5b46c3b558f8d0aae7fb46d Add another rule to simplify record concatenations for pretty-printing diff -r 16ee7ff7f119 -r dd12d6d9e9a7 src/elab_ops.sml --- a/src/elab_ops.sml Sat Apr 21 13:57:10 2012 -0400 +++ b/src/elab_ops.sml Sat Apr 21 14:06:03 2012 -0400 @@ -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 @@ | ((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 -r 16ee7ff7f119 -r dd12d6d9e9a7 tests/simplify.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/simplify.ur Sat Apr 21 14:06:03 2012 -0400 @@ -0,0 +1,1 @@ +fun main [r] (r : $([A = int] ++ ([B = float] ++ r))) : $([A = float] ++ ([B = int] ++ r)) = r