summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-12-26 11:56:40 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-12-26 11:56:40 -0500
commitc4120c8ddaa5340efad5f835ce4565f2a8ae2cbf (patch)
treeb4c6e798738335ded8d209afc369885664396d08 /tests
parent4300120544123e9dfb262eb8b4e3d0a0f17ff9bc (diff)
Make summary unification more conservative; infer implicit arguments after applications
Diffstat (limited to 'tests')
-rw-r--r--tests/impl.ur17
-rw-r--r--tests/impl.urp3
2 files changed, 13 insertions, 7 deletions
diff --git a/tests/impl.ur b/tests/impl.ur
index 5304598c..4a2e7a09 100644
--- a/tests/impl.ur
+++ b/tests/impl.ur
@@ -1,15 +1,18 @@
-val id = fn t :: Type => fn x : t => x
+fun id [t :: Type] (x : t) = x
val id_self = id [t :: Type -> t -> t] id
-val idi = fn t ::: Type => fn x : t => x
-val idi_self = idi idi
+fun idi [t ::: Type] (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}
+fun picker [na :: Name] [a ::: Type] [nb :: Name] [b ::: Type] [fs ::: {Type}] [[na] ~ [nb]] [[na, nb] ~ fs]
+ (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 getem2 = picker [#A] [_] {A = 0, B = 1.0, C = "hi", D = {}}
val getem3 = picker [#A] [_::Name] {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}
+fun picker_ohmy [na ::: Name] [a ::: Type] [nb ::: Name] [b ::: Type] [fs ::: {Type}] [[na] ~ [nb]] [[na, nb] ~ fs]
+ (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 = {}}
+
+fun proj [fs] [t] [nm :: Name] [[nm] ~ fs] (r : $([nm = t] ++ fs)) = r.nm
+val one = proj [#A] {A = 1, B = True}
diff --git a/tests/impl.urp b/tests/impl.urp
new file mode 100644
index 00000000..0ca72e15
--- /dev/null
+++ b/tests/impl.urp
@@ -0,0 +1,3 @@
+debug
+
+impl