From c98872439db4ffacd818c82b4d6e0498c342f225 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 24 Sep 2016 10:42:48 -0400 Subject: Add mapUX_rev --- lib/ur/top.ur | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/ur/top.ur') diff --git a/lib/ur/top.ur b/lib/ur/top.ur index 6c6c896c..02567917 100644 --- a/lib/ur/top.ur +++ b/lib/ur/top.ur @@ -179,6 +179,13 @@ fun mapUX [tf :: Type] [ctx :: {Unit}] {f [nm] [rest] r}{acc}) +fun mapUX_rev [tf :: Type] [ctx :: {Unit}] + (f : nm :: Name -> rest :: {Unit} -> [[nm] ~ rest] => tf -> xml ctx [] []) = + @@foldR [fn _ => tf] [fn _ => xml ctx [] []] + (fn [nm :: Name] [u :: Unit] [rest :: {Unit}] [[nm] ~ rest] r acc => + {acc}{f [nm] [rest] r}) + + fun mapX [K] [tf :: K -> Type] [ctx :: {Unit}] (f : nm :: Name -> t :: K -> rest :: {K} -> [[nm] ~ rest] => -- cgit v1.2.3