Notation "[ 'seq' E | i <- s ]" := (map (fun i => E) s)
(at level 0, E at level 99, i ident,
format "[ '[hv' 'seq'  E '/ '  |  i  <-  s ] ']'") : seq_scope.
Notation "[ 'seq' E | i <- s & C ]" := [seq E | i <- [seq i <- s | C]]
(at level 0, E at level 99, i ident,
format "[ '[hv' 'seq'  E '/ '  |  i  <-  s '/ '  &  C ] ']'") : seq_scope.
Notation "[ 'seq' E | i : T <- s ]" := (map (fun i : T => E) s)
(at level 0, E at level 99, i ident, only parsing) : seq_scope.
Notation "[ 'seq' E | i : T <- s & C ]" :=
[seq E | i : T <- [seq i : T <- s | C]]
(at level 0, E at level 99, i ident, only parsing) : seq_scope.

Lemma filter_mask T a (s : seq T) : filter a s = mask (map a s) s.