diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-10-20 10:29:17 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-10-20 10:29:17 -0400 |
commit | 66fa98fe9619afa56b10f1357edb617dc813051c (patch) | |
tree | 735539d263808b9d6d33d87eef8e4ea98f3b0e39 /demo/more/orm.ur | |
parent | eafb2bfc151efd5fe9a18dd5bba14141a1b832cf (diff) |
Adapted existing demos to tuple pattern-matching
Diffstat (limited to 'demo/more/orm.ur')
-rw-r--r-- | demo/more/orm.ur | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/demo/more/orm.ur b/demo/more/orm.ur index 24ccac67..620db9ad 100644 --- a/demo/more/orm.ur +++ b/demo/more/orm.ur @@ -1,9 +1,9 @@ con link = fn col_parent :: (Type * Type) => col_parent.1 -> transaction (option col_parent.2) fun noParent [t ::: Type] (_ : t) = return None -con meta = fn col_parent :: (Type * Type) => { - Link : link col_parent, - Inj : sql_injectable col_parent.1 +con meta = fn (col :: Type, parent :: Type) => { + Link : link (col, parent), + Inj : sql_injectable col } fun local [t :: Type] (inj : sql_injectable t) = {Link = noParent, @@ -55,10 +55,10 @@ functor Table(M : sig con col = fn t => {Exp : sql_exp [T = fs] [] [] t, Inj : sql_injectable t} val idCol = {Exp = sql_field [#T] [#Id], Inj = _} - con meta' = fn (fs :: {Type}) (col_parent :: (Type * Type)) => - {Col : {Exp : sql_exp [T = fs] [] [] col_parent.1, - Inj : sql_injectable col_parent.1}, - Parent : $fs -> transaction (option col_parent.2)} + con meta' = fn (fs :: {Type}) (col :: Type, parent :: Type) => + {Col : {Exp : sql_exp [T = fs] [] [] col, + Inj : sql_injectable col}, + Parent : $fs -> transaction (option parent)} val cols = foldR [meta] [fn before => after :: {(Type * Type)} -> [before ~ after] => $(map (meta' (map fst (before ++ after))) before)] (fn [nm :: Name] [ts :: (Type * Type)] [before :: {(Type * Type)}] |