law filter_filter
import bend-mathlib@0.8.1.0/list.bend as Listimport Base
1426# Filtering twice is filtering by both predicates: filter p (filter q xs) = filter (p and q) xs.
1427law filter_filter:
1428 for ~A: Data
1429 for ~p: A -> Bool
1430 for ~q: A -> Bool
1431 for xs: List<&2, A>
1432 {List.filter(~A, ~p, List.filter(~A, ~q, xs)) == List.filter(~A, ~(+x => Bool.and(p(x), q(x))), xs) : List<&2, A>}