∀ {α : Type u} {m : Type u_1 → Type u_2} {β : Type u_1} [inst : Monad m] (f : α → m (Option β)) (as : Array α)
  (start stop : ℕ),
  Array.filterMapM f as start stop =
    Array.foldlM
      (fun bs a => do
        let __do_lift ← f a
        match __do_lift with
          | some b => pure (bs.push b)
          | none => pure bs)
      #[] as start stop