fact: Definition max_apply {T} (c : T) : tactic := fun g=> match g with Metavar Typeₛ gT eg => (mfix1 go (d : dyn) : M (mlist (unit *m goal _)) := mmatch d return M (mlist (unit *m goal _)) with | [? T1 T2 f] @Dyn (T1 -> T2) f => e <- M.evar T1; r <- go (Dyn (f e)); M.ret ((m: tt, AnyMetavar Typeₛ _ e) :m: r) | [? T1 T2 f] @Dyn (forall x:T1, T2 x) f => e <- M.evar T1; r <- go (Dyn (f e)); M.ret r | Dyn eg =u> M.ret [m:] | _ => dcase d as ty, el in M.raise (T.CantApply ty gT) end) (Dyn c) | Metavar Propₛ _ _ => M.failwith "It's a prop!" end.
imports: Mtac2(Base Tactics Datatypes List Sorts) Strings.String