From c4120c8ddaa5340efad5f835ce4565f2a8ae2cbf Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 26 Dec 2009 11:56:40 -0500 Subject: Make summary unification more conservative; infer implicit arguments after applications --- CHANGELOG | 1 + demo/batchFun.ur | 78 +++++++++++------------ demo/crud.ur | 96 ++++++++++++++-------------- demo/metaform.ur | 26 ++++---- demo/more/dbgrid.ur | 34 +++++----- demo/more/grid.ur | 170 ++++++++++++++++++++++++------------------------- demo/more/grid1.ur | 14 ++-- demo/more/orm.ur | 48 +++++++------- demo/more/orm1.ur | 6 +- demo/more/versioned.ur | 76 +++++++++++----------- demo/sum.ur | 6 +- demo/tcSum.ur | 6 +- lib/ur/monad.ur | 60 ++++++++--------- lib/ur/monad.urs | 10 +-- lib/ur/top.ur | 56 ++++++++-------- lib/ur/top.urs | 28 ++++---- src/elaborate.sml | 58 +++++++++++++++-- src/urweb.grm | 17 ++--- tests/impl.ur | 17 +++-- tests/impl.urp | 3 + 20 files changed, 429 insertions(+), 381 deletions(-) create mode 100644 tests/impl.urp diff --git a/CHANGELOG b/CHANGELOG index d62e732a..16172985 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ Next ======== +- Automatic insertion of implicit arguments in more positions - Reifying expressions as URLs and redirecting to them explicitly - More syntactic sugar for SQL - Typing of SQL queries no longer exposes which tables were used in joins but diff --git a/demo/batchFun.ur b/demo/batchFun.ur index c75cbb07..3f0317a8 100644 --- a/demo/batchFun.ur +++ b/demo/batchFun.ur @@ -45,14 +45,14 @@ functor Make(M : sig fun add r = dml (insert t - (foldR2 [fst] [colMeta] - [fn cols => $(map (fn t :: (Type * Type) => - sql_exp [] [] [] t.1) cols)] - (fn [nm :: Name] [t :: (Type * Type)] [rest :: {(Type * Type)}] - [[nm] ~ rest] input col acc => - acc ++ {nm = @sql_inject col.Inject input}) - {} [M.cols] M.fl (r -- #Id) M.cols - ++ {Id = (SQL {[r.Id]})})) + (@foldR2 [fst] [colMeta] + [fn cols => $(map (fn t :: (Type * Type) => + sql_exp [] [] [] t.1) cols)] + (fn [nm :: Name] [t :: (Type * Type)] [rest :: {(Type * Type)}] + [[nm] ~ rest] input col acc => + acc ++ {nm = @sql_inject col.Inject input}) + {} M.fl (r -- #Id) M.cols + ++ {Id = (SQL {[r.Id]})})) fun doBatch ls = case ls of @@ -72,11 +72,11 @@ functor Make(M : sig | Cons (r, ls) => {[r.Id]} - {foldRX2 [colMeta] [fst] [_] - (fn [nm :: Name] [p :: (Type * Type)] [rest :: {(Type * Type)}] - [[nm] ~ rest] m v => - {m.Show v}) - [M.cols] M.fl M.cols (r -- #Id)} + {@foldRX2 [colMeta] [fst] [_] + (fn [nm :: Name] [p :: (Type * Type)] [rest :: {(Type * Type)}] + [[nm] ~ rest] m v => + {m.Show v}) + M.fl M.cols (r -- #Id)} {if withDel then