diff options
author | 2008-09-13 11:13:46 -0400 | |
---|---|---|
committer | 2008-09-13 11:13:46 -0400 | |
commit | 14c2a9e4b84d7344b40c7398c8896338939bfcc1 (patch) | |
tree | d4a6d210fcc14e26dd25bc5e1ac23fc640eee299 /lib/top.ur | |
parent | fd2079464d7b65430af09f2734fa55039006a3e3 (diff) |
foldTRX2
Diffstat (limited to 'lib/top.ur')
-rw-r--r-- | lib/top.ur | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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> |