comparison 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
comparison
equal deleted inserted replaced
992:b825d843b22d 993:10114d7b7477
90 | v => Some v) 90 | v => Some v)
91 91
92 fun txt [t] [ctx ::: {Unit}] [use ::: {Type}] (_ : show t) (v : t) = 92 fun txt [t] [ctx ::: {Unit}] [use ::: {Type}] (_ : show t) (v : t) =
93 cdata (show v) 93 cdata (show v)
94 94
95 fun map0 [K] [tf :: K -> Type] (f : t :: K -> tf t) [r :: {K}] (fl : folder r) =
96 fl [fn r :: {K} => $(map tf r)]
97 (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] acc =>
98 acc ++ {nm = f [t]})
99 {}
100
95 fun mp [K] [tf1 :: K -> Type] [tf2 :: K -> Type] (f : t ::: K -> tf1 t -> tf2 t) [r :: {K}] (fl : folder r) = 101 fun mp [K] [tf1 :: K -> Type] [tf2 :: K -> Type] (f : t ::: K -> tf1 t -> tf2 t) [r :: {K}] (fl : folder r) =
96 fl [fn r :: {K} => $(map tf1 r) -> $(map tf2 r)] 102 fl [fn r :: {K} => $(map tf1 r) -> $(map tf2 r)]
97 (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] acc r => 103 (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] acc r =>
98 acc (r -- nm) ++ {nm = f r.nm}) 104 acc (r -- nm) ++ {nm = f r.nm})
99 (fn _ => {}) 105 (fn _ => {})