fact: Fixpoint unfold_funs {A} (t: A) (n: nat) {struct n} : M A := match n with | 0 => M.ret t | S n' => (mtmmatch A as A' return A =m= A' -> M A' with | [? B (fty : B -> Type)] forall x, fty x =m> fun H => let t' := reduce RedSimpl match H in meq _ P return P with meq_refl => t end in M.nu (FreshFrom "A") mNone (fun x=> r <- unfold_funs (t' x) n'; abs x r) | [? A'] A' =m> fun H => match H in meq _ P return M P with meq_refl => M.ret t end end) meq_refl end%MC.
imports: Mtac2(Datatypes List Mtac2 DepDestruct Sorts MTeleMatch)