fact: Fixpoint insertM `{Monad m} {A : Type} (P : A → A → m bool) (z : A) (l : list A) : m (list A) := match l with | nil => pure (cons z nil) | cons x xs => b <- P x z ;; if (b : bool) then cons x <$> insertM P z xs else pure (cons z (cons x xs)) end.
imports: Coq.Lists.List Equations(Equations) Equations.Type.EqDec Category.Lib Category.Theory.Coq.Functor Category.Theory.Coq.Applicative Category.Theory.Coq.Monad Category.Theory.Coq.Maybe Coq.Lists.List