view tests/reduce.ur @ 1908:ab1a3737b306

make clean: Clean bin/mlton, src/urweb.mlton.lex, src/urweb.mlton.grm Signed-off-by: Anders Kaseorg <andersk@mit.edu> --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
author Anders Kaseorg <andersk@mit.edu>
date Fri, 22 Nov 2013 09:36:14 -0500
parents 71bafe66dbe1
children
line wrap: on
line source
con c1 = int
con c2 = (fn t :: Type => t) int

con id = fn t :: Type => t
con c3 = id int

con fst = fn t1 :: Type => fn t2 :: Type => t1
con c4 = fst int string

con snd = fn t1 :: Type => fn t2 :: Type => t2
con c5 = snd int string

con apply = fn f :: Type -> Type => fn t :: Type => f t
con c6 = apply id int
con c7 = apply (fst int) string

val tickle = fn n :: Name => fn t :: Type => fn fs :: {Type} =>
        fn x : $([n = t] ++ fs) => x
val tickleA = tickle[#A][int][[B = string]]
val test_tickleA = tickleA {A = 6, B = "13"}

val grab = fn n :: Name => fn t ::: Type => fn fs ::: {Type} =>
        fn x : $([n = t] ++ fs) => x.n
val test_grab1 = grab[#A] {A = 6, B = "13"}
val test_grab2 = grab[#B] {A = 6, B = "13"}

val main = {A = test_grab1, B = test_grab2}