diff options
author | 2009-10-06 15:39:27 -0400 | |
---|---|---|
committer | 2009-10-06 15:39:27 -0400 | |
commit | 8acfc38ef053ab673aad1c01b67a9ded9cdc3dff (patch) | |
tree | fa80b1891097e60c758ecb12fd8c441f37a03c85 /lib/ur/top.ur | |
parent | 1de883737e14d5b6dbd442c5f92ca6e97d9322b5 (diff) |
SELECT DISTINCT; eta expansion during Cjrization
Diffstat (limited to 'lib/ur/top.ur')
-rw-r--r-- | lib/ur/top.ur | 6 |
1 files changed, 6 insertions, 0 deletions
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 => |