Mercurial > urweb
diff lib/ur/top.ur @ 993:10114d7b7477
SELECT DISTINCT; eta expansion during Cjrization
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 06 Oct 2009 15:39:27 -0400 |
parents | 37dd42935dad |
children | 61c30f0742d7 |
line wrap: on
line diff
--- a/lib/ur/top.ur Tue Oct 06 13:11:03 2009 -0400 +++ b/lib/ur/top.ur Tue Oct 06 15:39:27 2009 -0400 @@ -92,6 +92,12 @@ 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 =>