let rec levels_from_domains_acc domains levels = match domains with | [] -> levels | hd::tl -> levels_from_domains_acc tl (levels @ [M(hd)])