aboutsummaryrefslogtreecommitdiffhomepage
path: root/demo/crud.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-10-27 08:27:45 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-10-27 08:27:45 -0400
commit5d118aafe9b7cecdb429836b61bb9fdf6e8fc24e (patch)
tree4f228e945fd003d5a15b6d45fb34f50b6a41722c /demo/crud.ur
parent794a3ad4e4713e74d2118d8f24b09ef4d35bd34f (diff)
Remove need for '() <-' notation
Diffstat (limited to 'demo/crud.ur')
-rw-r--r--demo/crud.ur44
1 files changed, 22 insertions, 22 deletions
diff --git a/demo/crud.ur b/demo/crud.ur
index 472de6d4..77fccf16 100644
--- a/demo/crud.ur
+++ b/demo/crud.ur
@@ -94,15 +94,15 @@ functor Make(M : sig
and create (inputs : $(mapT2T sndTT M.cols)) =
id <- nextval seq;
- () <- dml (insert tab
- (foldT2R2 [sndTT] [colMeta]
- [fn cols => $(mapT2T (fn t :: (Type * Type) =>
- 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))
- {} [M.cols] inputs M.cols
- with #Id = (SQL {id})));
+ dml (insert tab
+ (foldT2R2 [sndTT] [colMeta]
+ [fn cols => $(mapT2T (fn t :: (Type * Type) =>
+ 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))
+ {} [M.cols] inputs M.cols
+ with #Id = (SQL {id})));
ls <- list ();
return <xml><body>
<p>Inserted with ID {[id]}.</p>
@@ -111,18 +111,18 @@ functor Make(M : sig
</body></xml>
and save (id : int) (inputs : $(mapT2T sndTT M.cols)) =
- () <- dml (update [mapT2T fstTT M.cols]
- (foldT2R2 [sndTT] [colMeta]
- [fn cols => $(mapT2T (fn t :: (Type * Type) =>
- sql_exp [T = [Id = int]
- ++ mapT2T fstTT M.cols]
- [] [] 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))
- {} [M.cols] inputs M.cols)
- tab (WHERE T.Id = {id}));
+ dml (update [mapT2T fstTT M.cols]
+ (foldT2R2 [sndTT] [colMeta]
+ [fn cols => $(mapT2T (fn t :: (Type * Type) =>
+ sql_exp [T = [Id = int]
+ ++ mapT2T fstTT M.cols]
+ [] [] 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))
+ {} [M.cols] inputs M.cols)
+ tab (WHERE T.Id = {id}));
ls <- list ();
return <xml><body>
<p>Saved!</p>
@@ -150,7 +150,7 @@ functor Make(M : sig
</form></body></xml>
and delete (id : int) =
- () <- dml (DELETE FROM tab WHERE Id = {id});
+ dml (DELETE FROM tab WHERE Id = {id});
ls <- list ();
return <xml><body>
<p>The deed is done.</p>