comparison src/monoize.sml @ 751:f95d652086cd

RIGHT and FULL JOIN
author Adam Chlipala <adamc@hcoop.net>
date Tue, 28 Apr 2009 11:14:24 -0400
parents 059074c8d2fc
children d484df4e841a
comparison
equal deleted inserted replaced
750:059074c8d2fc 751:f95d652086cd
1772 (L'.EAbs ("tab2", s, (L'.TFun (s, s), loc), 1772 (L'.EAbs ("tab2", s, (L'.TFun (s, s), loc),
1773 (L'.EAbs ("on", s, s, 1773 (L'.EAbs ("on", s, s,
1774 strcat [(L'.EPrim (Prim.String "("), loc), 1774 strcat [(L'.EPrim (Prim.String "("), loc),
1775 (L'.ERel 2, loc), 1775 (L'.ERel 2, loc),
1776 (L'.EPrim (Prim.String " LEFT JOIN "), loc), 1776 (L'.EPrim (Prim.String " LEFT JOIN "), loc),
1777 (L'.ERel 1, loc),
1778 (L'.EPrim (Prim.String " ON "), loc),
1779 (L'.ERel 0, loc),
1780 (L'.EPrim (Prim.String ")"), loc)]),
1781 loc)), loc)), loc)), loc),
1782 fm)
1783 end
1784 | L.ECApp ((L.ECApp ((L.EFfi ("Basis", "sql_right_join"), _), (L.CRecord (_, left), _)), _), _) =>
1785 let
1786 val s = (L'.TFfi ("Basis", "string"), loc)
1787 in
1788 ((L'.EAbs ("_", outerRec left,
1789 (L'.TFun (s, (L'.TFun (s, (L'.TFun (s, s), loc)), loc)), loc),
1790 (L'.EAbs ("tab1", s, (L'.TFun (s, (L'.TFun (s, s), loc)), loc),
1791 (L'.EAbs ("tab2", s, (L'.TFun (s, s), loc),
1792 (L'.EAbs ("on", s, s,
1793 strcat [(L'.EPrim (Prim.String "("), loc),
1794 (L'.ERel 2, loc),
1795 (L'.EPrim (Prim.String " RIGHT JOIN "), loc),
1796 (L'.ERel 1, loc),
1797 (L'.EPrim (Prim.String " ON "), loc),
1798 (L'.ERel 0, loc),
1799 (L'.EPrim (Prim.String ")"), loc)]),
1800 loc)), loc)), loc)), loc),
1801 fm)
1802 end
1803 | L.ECApp ((L.ECApp ((L.EFfi ("Basis", "sql_full_join"), _), (L.CRecord (_, left), _)), _),
1804 (L.CRecord (_, right), _)) =>
1805 let
1806 val s = (L'.TFfi ("Basis", "string"), loc)
1807 in
1808 ((L'.EAbs ("_", outerRec (left @ right),
1809 (L'.TFun (s, (L'.TFun (s, (L'.TFun (s, s), loc)), loc)), loc),
1810 (L'.EAbs ("tab1", s, (L'.TFun (s, (L'.TFun (s, s), loc)), loc),
1811 (L'.EAbs ("tab2", s, (L'.TFun (s, s), loc),
1812 (L'.EAbs ("on", s, s,
1813 strcat [(L'.EPrim (Prim.String "("), loc),
1814 (L'.ERel 2, loc),
1815 (L'.EPrim (Prim.String " FULL JOIN "), loc),
1777 (L'.ERel 1, loc), 1816 (L'.ERel 1, loc),
1778 (L'.EPrim (Prim.String " ON "), loc), 1817 (L'.EPrim (Prim.String " ON "), loc),
1779 (L'.ERel 0, loc), 1818 (L'.ERel 0, loc),
1780 (L'.EPrim (Prim.String ")"), loc)]), 1819 (L'.EPrim (Prim.String ")"), loc)]),
1781 loc)), loc)), loc)), loc), 1820 loc)), loc)), loc)), loc),