fact: Fixpoint map_without_repetition (A B : Set) (eqA : forall (a1 a2 : A), {a1=a2}+{a1<>a2}) (f : A -> option B) (l : list A) {struct l} : list B := match l with | nil => (nil : list B) | h :: nil => match f h with | None => nil | Some f_h => f_h :: nil end | h1 :: ((h2 :: tl) as l1) => if (eqA h1 h2) then map_without_repetition eqA f l1 else match f h1 with | None => map_without_repetition eqA f l1 | Some f_h1 => f_h1 :: (map_without_repetition eqA f l1) end end.
imports: List Arith