changeset 17:9bd8669d53c2

Further experiments with implicit arguments
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 14:10:51 -0400 (2008-06-08)
parents bc7b76ca57e0
children 9a578171de9e
files src/elab_env.sml src/elaborate.sml tests/impl.lac
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/elab_env.sml	Sun Jun 08 13:59:29 2008 -0400
+++ b/src/elab_env.sml	Sun Jun 08 14:10:51 2008 -0400
@@ -54,7 +54,7 @@
                                              c
                                          else
                                              CRel (xn + 1)
-                                       | CUnif _ => raise SynUnif
+                                       (*| CUnif _ => raise SynUnif*)
                                        | _ => c,
                 bind = fn (bound, U.Con.Rel _) => bound + 1
                         | (bound, _) => bound}
--- a/src/elaborate.sml	Sun Jun 08 13:59:29 2008 -0400
+++ b/src/elaborate.sml	Sun Jun 08 14:10:51 2008 -0400
@@ -357,7 +357,7 @@
                                           #1 rep
                                       else
                                           c
-                                    | L'.CUnif _ => raise SynUnif
+                                    (*| L'.CUnif _ => raise SynUnif*)
                                     | _ => c,
                 bind = fn ((xn, rep), U.Con.Rel _) => (xn+1, liftConInCon 0 rep)
                         | (ctx, _) => ctx}
--- a/tests/impl.lac	Sun Jun 08 13:59:29 2008 -0400
+++ b/tests/impl.lac	Sun Jun 08 14:10:51 2008 -0400
@@ -3,3 +3,11 @@
 
 val idi = fn t ::: Type => fn x : t => x
 val idi_self = idi idi
+
+val picker = fn na :: Name => fn a ::: Type => fn nb :: Name => fn b ::: Type => fn fs ::: {Type} =>
+        fn r : $([na = a, nb = b] ++ fs) => {na = r.na, nb = r.nb}
+val getem = picker [#A] [#C] {A = 0, B = 1.0, C = "hi", D = {}}
+
+val picker_ohmy = fn na ::: Name => fn a ::: Type => fn nb ::: Name => fn b ::: Type => fn fs ::: {Type} =>
+        fn r : $([na = a, nb = b] ++ fs) => {na = r.na, nb = r.nb}
+val getem_ohmy = picker_ohmy {A = 0, B = 1.0, C = "hi", D = {}}