comparison lib/ur/top.ur @ 1173:983d9b38abc7

Fix parsing of space-free .urp directives; use 'class' for 'c*' tags
author Adam Chlipala <adamc@hcoop.net>
date Sun, 28 Feb 2010 15:46:41 -0500
parents ad15700272f6
children 26fed2c4f5be
comparison
equal deleted inserted replaced
1172:ad15700272f6 1173:983d9b38abc7
136 fl [fn r :: {Unit} => $(mapU tf1 r) -> $(mapU tf2 r) -> tr r] 136 fl [fn r :: {Unit} => $(mapU tf1 r) -> $(mapU tf2 r) -> tr r]
137 (fn [nm :: Name] [t :: Unit] [rest :: {Unit}] [[nm] ~ rest] acc r1 r2 => 137 (fn [nm :: Name] [t :: Unit] [rest :: {Unit}] [[nm] ~ rest] acc r1 r2 =>
138 f [nm] [rest] ! r1.nm r2.nm (acc (r1 -- nm) (r2 -- nm))) 138 f [nm] [rest] ! r1.nm r2.nm (acc (r1 -- nm) (r2 -- nm)))
139 (fn _ _ => i) 139 (fn _ _ => i)
140 140
141 fun foldURX2 [tf1 :: Type] [tf2 :: Type] [ctx :: {Unit}]
142 (f : nm :: Name -> rest :: {Unit}
143 -> [[nm] ~ rest] =>
144 tf1 -> tf2 -> xml ctx [] []) =
145 @@foldUR2 [tf1] [tf2] [fn _ => xml ctx [] []]
146 (fn [nm :: Name] [rest :: {Unit}] [[nm] ~ rest] v1 v2 acc =>
147 <xml>{f [nm] [rest] ! v1 v2}{acc}</xml>)
148 <xml/>
149
150 fun foldR [K] [tf :: K -> Type] [tr :: {K} -> Type] 141 fun foldR [K] [tf :: K -> Type] [tr :: {K} -> Type]
151 (f : nm :: Name -> t :: K -> rest :: {K} 142 (f : nm :: Name -> t :: K -> rest :: {K}
152 -> [[nm] ~ rest] => 143 -> [[nm] ~ rest] =>
153 tf t -> tr rest -> tr ([nm = t] ++ rest)) 144 tf t -> tr rest -> tr ([nm = t] ++ rest))
154 (i : tr []) [r ::: {K}] (fl : folder r) = 145 (i : tr []) [r ::: {K}] (fl : folder r) =
193 @@foldR [tf] [fn _ => xml ctx [] []] 184 @@foldR [tf] [fn _ => xml ctx [] []]
194 (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] r acc => 185 (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] r acc =>
195 <xml>{f [nm] [t] [rest] ! r}{acc}</xml>) 186 <xml>{f [nm] [t] [rest] ! r}{acc}</xml>)
196 <xml/> 187 <xml/>
197 188
189 fun mapUX2 [tf1 :: Type] [tf2 :: Type] [ctx :: {Unit}]
190 (f : nm :: Name -> rest :: {Unit}
191 -> [[nm] ~ rest] =>
192 tf1 -> tf2 -> xml ctx [] []) =
193 @@foldUR2 [tf1] [tf2] [fn _ => xml ctx [] []]
194 (fn [nm :: Name] [rest :: {Unit}] [[nm] ~ rest] v1 v2 acc =>
195 <xml>{f [nm] [rest] ! v1 v2}{acc}</xml>)
196 <xml/>
197
198 fun mapX2 [K] [tf1 :: K -> Type] [tf2 :: K -> Type] [ctx :: {Unit}] 198 fun mapX2 [K] [tf1 :: K -> Type] [tf2 :: K -> Type] [ctx :: {Unit}]
199 (f : nm :: Name -> t :: K -> rest :: {K} 199 (f : nm :: Name -> t :: K -> rest :: {K}
200 -> [[nm] ~ rest] => 200 -> [[nm] ~ rest] =>
201 tf1 t -> tf2 t -> xml ctx [] []) = 201 tf1 t -> tf2 t -> xml ctx [] []) =
202 @@foldR2 [tf1] [tf2] [fn _ => xml ctx [] []] 202 @@foldR2 [tf1] [tf2] [fn _ => xml ctx [] []]