comparison tests/impl.lac @ 18:9a578171de9e

Unification wildcards
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 14:25:27 -0400
parents 9bd8669d53c2
children
comparison
equal deleted inserted replaced
17:9bd8669d53c2 18:9a578171de9e
5 val idi_self = idi idi 5 val idi_self = idi idi
6 6
7 val picker = fn na :: Name => fn a ::: Type => fn nb :: Name => fn b ::: Type => fn fs ::: {Type} => 7 val picker = fn na :: Name => fn a ::: Type => fn nb :: Name => fn b ::: Type => fn fs ::: {Type} =>
8 fn r : $([na = a, nb = b] ++ fs) => {na = r.na, nb = r.nb} 8 fn r : $([na = a, nb = b] ++ fs) => {na = r.na, nb = r.nb}
9 val getem = picker [#A] [#C] {A = 0, B = 1.0, C = "hi", D = {}} 9 val getem = picker [#A] [#C] {A = 0, B = 1.0, C = "hi", D = {}}
10 val getem2 = picker [#A] [_] {A = 0, B = 1.0, C = "hi", D = {}}
11 val getem3 = picker [#A] [_::Name] {A = 0, B = 1.0, C = "hi", D = {}}
10 12
11 val picker_ohmy = fn na ::: Name => fn a ::: Type => fn nb ::: Name => fn b ::: Type => fn fs ::: {Type} => 13 val picker_ohmy = fn na ::: Name => fn a ::: Type => fn nb ::: Name => fn b ::: Type => fn fs ::: {Type} =>
12 fn r : $([na = a, nb = b] ++ fs) => {na = r.na, nb = r.nb} 14 fn r : $([na = a, nb = b] ++ fs) => {na = r.na, nb = r.nb}
13 val getem_ohmy = picker_ohmy {A = 0, B = 1.0, C = "hi", D = {}} 15 val getem_ohmy = picker_ohmy {A = 0, B = 1.0, C = "hi", D = {}}