comparison src/elaborate.sml @ 412:df4cbd90a26e

Infering sum rows
author Adam Chlipala <adamc@hcoop.net>
date Tue, 21 Oct 2008 19:31:11 -0400
parents 06fcddcd20d3
children 6a0e54400805
comparison
equal deleted inserted replaced
411:06fcddcd20d3 412:df4cbd90a26e
1 (* Copyright (c) 2008, Adam Chlipala 1 (* Copyright (c) 2008, Adam Chlipala
2 * All rights reserved. 2 * All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met: 5 * modification, are permitted provided that the following conditions are met:
6 * 6 *
741 val loc = #2 c1 741 val loc = #2 c1
742 742
743 fun unfold (dom, ran, f, i, r, c) = 743 fun unfold (dom, ran, f, i, r, c) =
744 let 744 let
745 val nm = cunif (loc, (L'.KName, loc)) 745 val nm = cunif (loc, (L'.KName, loc))
746 val v = cunif (loc, dom) 746 val v =
747 case dom of
748 (L'.KUnit, _) => (L'.CUnit, loc)
749 | _ => cunif (loc, dom)
747 val rest = cunif (loc, (L'.KRecord dom, loc)) 750 val rest = cunif (loc, (L'.KRecord dom, loc))
748 val acc = (L'.CFold (dom, ran), loc) 751 val acc = (L'.CFold (dom, ran), loc)
749 val acc = (L'.CApp (acc, f), loc) 752 val acc = (L'.CApp (acc, f), loc)
750 val acc = (L'.CApp (acc, i), loc) 753 val acc = (L'.CApp (acc, i), loc)
751 val acc = (L'.CApp (acc, rest), loc) 754 val acc = (L'.CApp (acc, rest), loc)