diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-10-06 15:39:27 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-10-06 15:39:27 -0400 |
commit | 5765efc372a628ede62d8b27c799708f530a3456 (patch) | |
tree | fa80b1891097e60c758ecb12fd8c441f37a03c85 /lib | |
parent | 37f1efc23e011927873cfc5871ac7686eac5a745 (diff) |
SELECT DISTINCT; eta expansion during Cjrization
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ur/basis.urs | 3 | ||||
-rw-r--r-- | lib/ur/top.ur | 6 | ||||
-rw-r--r-- | lib/ur/top.urs | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index b7468d2f..9ddae8fe 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -291,7 +291,8 @@ val sql_query1 : tables ::: {{Type}} -> grouped ::: {{Type}} -> selectedFields ::: {{Type}} -> selectedExps ::: {Type} - -> {From : sql_from_items tables, + -> {Distinct : bool, + From : sql_from_items tables, Where : sql_exp tables [] [] bool, GroupBy : sql_subset tables grouped, Having : sql_exp grouped tables [] bool, diff --git a/lib/ur/top.ur b/lib/ur/top.ur index 67e75573..a2395d4f 100644 --- a/lib/ur/top.ur +++ b/lib/ur/top.ur @@ -92,6 +92,12 @@ fun read_option [t ::: Type] (_ : read t) = fun txt [t] [ctx ::: {Unit}] [use ::: {Type}] (_ : show t) (v : t) = cdata (show v) +fun map0 [K] [tf :: K -> Type] (f : t :: K -> tf t) [r :: {K}] (fl : folder r) = + fl [fn r :: {K} => $(map tf r)] + (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] acc => + acc ++ {nm = f [t]}) + {} + fun mp [K] [tf1 :: K -> Type] [tf2 :: K -> Type] (f : t ::: K -> tf1 t -> tf2 t) [r :: {K}] (fl : folder r) = fl [fn r :: {K} => $(map tf1 r) -> $(map tf2 r)] (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] acc r => diff --git a/lib/ur/top.urs b/lib/ur/top.urs index 637c4e5d..ef907760 100644 --- a/lib/ur/top.urs +++ b/lib/ur/top.urs @@ -45,6 +45,9 @@ val read_option : t ::: Type -> read t -> read (option t) val txt : t ::: Type -> ctx ::: {Unit} -> use ::: {Type} -> show t -> t -> xml ctx use [] +val map0 : K --> tf :: (K -> Type) + -> (t :: K -> tf t) + -> r :: {K} -> folder r -> $(map tf r) val mp : K --> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> (t ::: K -> tf1 t -> tf2 t) -> r :: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) |