Canonical Structure fmap_eqType := EqType (finMap K V) fmap_eqMixin.
End EqType.
(* mapping a function over a contents of a finite map *)
Section Map.
Variables (K : ordType) (U V : Type) (f : U -> V).
Definition mapf' (m : seq (K * U)) : seq (K * V) :=
map (fun kv => (key kv, f (value kv))) m.

Lemma map_key_mapf (m : seq (K * U)) : map key (mapf' m) = map key m.
Definition mapf (m : finMap K U) : finMap K V :=
let: FinMap _ pf := m in FinMap (sorted_map pf).