From 1a5acb4732536e4be288895eb89d139b19aebc94 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 21 Oct 2008 16:41:11 -0400 Subject: New implicit argument handling --- tests/crud.ur | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/crud.ur') diff --git a/tests/crud.ur b/tests/crud.ur index 5427100c..8aff038d 100644 --- a/tests/crud.ur +++ b/tests/crud.ur @@ -11,19 +11,19 @@ con colsMeta = fn cols :: {(Type * Type)} => $(Top.mapT2T colMeta cols) fun default (t ::: Type) (sh : show t) (rd : read t) (inj : sql_injectable t) name : colMeta (t, string) = {Nam = name, - Show = txt _, + Show = txt, Widget = fn nm :: Name => , WidgetPopulated = fn (nm :: Name) n => - , - Parse = readError _, + , + Parse = readError, Inject = _} -val int = default _ _ _ -val float = default _ _ _ -val string = default _ _ _ +val int = default +val float = default +val string = default fun bool name = {Nam = name, - Show = txt _, + Show = txt, Widget = fn nm :: Name => , WidgetPopulated = fn (nm :: Name) b => , @@ -53,11 +53,11 @@ functor Make(M : sig sql_exp [] [] [] t.1) cols)] (fn (nm :: Name) (t :: (Type * Type)) (rest :: {(Type * Type)}) [[nm] ~ rest] => - fn input col acc => acc with nm = sql_inject col.Inject (col.Parse input)) + fn input col acc => acc with nm = @sql_inject col.Inject (col.Parse input)) {} [M.cols] inputs M.cols with #Id = (SQL {id}))); return - Inserted with ID {txt _ id}. + Inserted with ID {[id]}. fun save (id : int) (inputs : $(mapT2T sndTT M.cols)) = @@ -70,7 +70,7 @@ functor Make(M : sig (fn (nm :: Name) (t :: (Type * Type)) (rest :: {(Type * Type)}) [[nm] ~ rest] => fn input col acc => acc with nm = - sql_inject col.Inject (col.Parse input)) + @sql_inject col.Inject (col.Parse input)) {} [M.cols] inputs M.cols) tab (WHERE T.Id = {id})); return @@ -103,7 +103,7 @@ functor Make(M : sig fun confirm (id : int) = return -

Are you sure you want to delete ID #{txt _ id}?

+

Are you sure you want to delete ID #{[id]}?

I was born sure!

@@ -112,7 +112,7 @@ functor Make(M : sig rows <- queryX (SELECT * FROM tab AS T) (fn (fs : {T : $([Id = int] ++ mapT2T fstTT M.cols)}) => - {txt _ fs.T.Id} + {[fs.T.Id]} {foldT2RX2 [fstTT] [colMeta] [tr] (fn (nm :: Name) (t :: (Type * Type)) (rest :: {(Type * Type)}) [[nm] ~ rest] v col => -- cgit v1.2.3