adamc@1093: fun id [t :: Type] (x : t) = x adamc@15: val id_self = id [t :: Type -> t -> t] id adamc@15: adamc@1093: fun idi [t ::: Type] (x : t) = x adamc@1093: val idi_self = idi @@idi adamc@17: adamc@1093: fun picker [na :: Name] [a ::: Type] [nb :: Name] [b ::: Type] [fs ::: {Type}] [[na] ~ [nb]] [[na, nb] ~ fs] adamc@1093: (r : $([na = a, nb = b] ++ fs)) = {na = r.na, nb = r.nb} adamc@17: val getem = picker [#A] [#C] {A = 0, B = 1.0, C = "hi", D = {}} adamc@18: val getem2 = picker [#A] [_] {A = 0, B = 1.0, C = "hi", D = {}} adamc@18: val getem3 = picker [#A] [_::Name] {A = 0, B = 1.0, C = "hi", D = {}} adamc@17: adamc@1093: fun picker_ohmy [na ::: Name] [a ::: Type] [nb ::: Name] [b ::: Type] [fs ::: {Type}] [[na] ~ [nb]] [[na, nb] ~ fs] adamc@1093: (r : $([na = a, nb = b] ++ fs)) = {na = r.na, nb = r.nb} adamc@17: val getem_ohmy = picker_ohmy {A = 0, B = 1.0, C = "hi", D = {}} adamc@1093: adamc@1093: fun proj [fs] [t] [nm :: Name] [[nm] ~ fs] (r : $([nm = t] ++ fs)) = r.nm adamc@1093: val one = proj [#A] {A = 1, B = True}