aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/ur/list.urs
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-12-31 18:07:53 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-12-31 18:07:53 -0500
commit76a84dd3fb97b56605292c4f0eab2febe3c6a7ed (patch)
tree0bde2b80fc3e8df14cd6e16f05bdd88e062aca9a /lib/ur/list.urs
parentd57cc15e6b5c1f77ebfbfa222283809a4f594e36 (diff)
Eta-expand bodies of transaction functions in Monoization, to enable later optimization
Diffstat (limited to 'lib/ur/list.urs')
-rw-r--r--lib/ur/list.urs14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/ur/list.urs b/lib/ur/list.urs
index 5f3fad9c..c5e41816 100644
--- a/lib/ur/list.urs
+++ b/lib/ur/list.urs
@@ -27,6 +27,8 @@ val mapX : a ::: Type -> ctx ::: {Unit} -> (a -> xml ctx [] []) -> t a -> xml ct
val mapM : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type
-> (a -> m b) -> t a -> m (t b)
+val mapPartialM : m ::: (Type -> Type) -> monad m -> a ::: Type -> b ::: Type -> (a -> m (option b)) -> t a -> m (t b)
+
val mapXM : m ::: (Type -> Type) -> monad m -> a ::: Type -> ctx ::: {Unit}
-> (a -> m (xml ctx [] [])) -> t a -> m (xml ctx [] [])
@@ -53,6 +55,18 @@ val mapQuery : tables ::: {{Type}} -> exps ::: {Type} -> t ::: Type
-> ($(exps ++ map (fn fields :: {Type} => $fields) tables) -> t)
-> transaction (list t)
+val mapQueryM : tables ::: {{Type}} -> exps ::: {Type} -> t ::: Type
+ -> [tables ~ exps] =>
+ sql_query tables exps
+ -> ($(exps ++ map (fn fields :: {Type} => $fields) tables) -> transaction t)
+ -> transaction (list t)
+
+val mapQueryPartialM : tables ::: {{Type}} -> exps ::: {Type} -> t ::: Type
+ -> [tables ~ exps] =>
+ sql_query tables exps
+ -> ($(exps ++ map (fn fields :: {Type} => $fields) tables) -> transaction (option t))
+ -> transaction (list t)
+
(** Association lists *)
val assoc : a ::: Type -> b ::: Type -> eq a -> a -> t (a * b) -> option b