summaryrefslogtreecommitdiff
path: root/lib/top.ur
diff options
context:
space:
mode:
Diffstat (limited to 'lib/top.ur')
-rw-r--r--lib/top.ur9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/top.ur b/lib/top.ur
index d94f8bf6..af009242 100644
--- a/lib/top.ur
+++ b/lib/top.ur
@@ -17,3 +17,12 @@ fun foldTR2 (tf1 :: Type -> Type) (tf2 :: Type -> Type) (tr :: {Type} -> Type)
[[nm] ~ rest] =>
fn r1 r2 => f [nm] [t] [rest] r1.nm r2.nm (acc (r1 -- nm) (r2 -- nm)))
(fn _ _ => i)
+
+fun foldTRX2 (tf1 :: Type -> Type) (tf2 :: Type -> Type) (ctx :: {Unit})
+ (f : nm :: Name -> t :: Type -> rest :: {Type} -> [nm] ~ rest
+ -> tf1 t -> tf2 t -> xml ctx [] []) =
+ foldTR2 [tf1] [tf2] [fn _ => xml ctx [] []]
+ (fn (nm :: Name) (t :: Type) (rest :: {Type}) =>
+ [[nm] ~ rest] =>
+ fn r1 r2 acc => <xml>{f [nm] [t] [rest] r1 r2}{acc}</xml>)
+ <xml></xml>