| Root (arg, index) -> Root (k arg, k index)
| Break -> Break
| Box (kind, terms) -> Box (kind, List.map k terms)
+ | Group terms -> Group (List.map k terms)
let visit_magic k = function
| List0 (t, l) -> List0 (k t, l)
| [ a ] -> a
| l -> Layout (Box ((H, false, false), l))
+let group = function
+ | [ a ] -> a
+ | l -> Layout (Group l)
+
+let ungroup =
+ let rec aux acc =
+ function
+ [] -> List.rev acc
+ | Layout (Group terms) :: terms' -> aux acc (terms @ terms')
+ | term :: terms -> aux (term :: acc) terms
+ in
+ aux []
+
+let dress sauce =
+ let rec aux =
+ function
+ | [] -> []
+ | [hd] -> [hd]
+ | hd :: tl -> hd :: sauce :: aux tl
+ in
+ aux
+
let find_appl_pattern_uris ap =
let rec aux acc =
function