fact: Definition nth {A} (n : nat) (f : A -> gtactic A) : selector A := fun l => let (l1, l2) := dreduce (@nsplit) (nsplit n l) in match mhd_error l2 with | mNone => M.raise NoGoalsLeft | mSome (m: x, g) => goals <- open_and_apply (f x) g; let res := dreduce (@mapp, @mtl) (l1 +m+ goals +m+ mtl l2) in filter_goals res end.
imports: Strings.String ssrmatching.ssrmatching Mtac2(Logic Datatypes List Utils Logic intf.Sorts) Strings.String NArith.BinNat NArith.BinNatDef