Set Implicit Arguments.
(*Require ne_list.*)
Require ne_tree.
Definition C := ne_tree.T.
Definition ret {A: Set}: A -> C A := @ne_tree.Leaf A.
Fixpoint bind (A B: Set) (m: C A) (k: A -> C B): C B :=
match m with
| ne_tree.Leaf a => k a
| ne_tree.Node ts => ne_tree.Node (ne_list.map (fun x => bind x k) ts)
end.
Let runit (a b: Set) (x: a) (f: a -> C b): bind (ret x) f = f x.
Definition M: Monad := Build_Monad C bind (@ret) runit lunit assoc.

Lemma ext: extMonad M.
Proof with auto.