comparison tests/impl.lac @ 17:9bd8669d53c2

Further experiments with implicit arguments
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 14:10:51 -0400
parents 1e645beb3f3b
children 9a578171de9e
comparison
equal deleted inserted replaced
16:bc7b76ca57e0 17:9bd8669d53c2
1 val id = fn t :: Type => fn x : t => x 1 val id = fn t :: Type => fn x : t => x
2 val id_self = id [t :: Type -> t -> t] id 2 val id_self = id [t :: Type -> t -> t] id
3 3
4 val idi = fn t ::: Type => fn x : t => x 4 val idi = fn t ::: Type => fn x : t => x
5 val idi_self = idi idi 5 val idi_self = idi idi
6
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}
9 val getem = picker [#A] [#C] {A = 0, B = 1.0, C = "hi", D = {}}
10
11 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}
13 val getem_ohmy = picker_ohmy {A = 0, B = 1.0, C = "hi", D = {}}