MK
Size: a a a
MK
MK
AV
AA
AV
AA
AV
K
map (fmap (\p -> length . filter p $ bs))
AV
K
AV
AV
AV
MK
λ> let as = [("even", even), ("odd", odd)] in M.toList $ M.fromListWith(+) $ concatMap (\i -> map (\(a, p) -> (a, if p i then 1 else 0)) as) [1,2,3,4,5]
[("even",2),("odd",3)]
AV
AV
λ> let as = [("even", even), ("odd", odd)] in M.toList $ M.fromListWith(+) $ concatMap (\i -> map (\(a, p) -> (a, if p i then 1 else 0)) as) [1,2,3,4,5]
[("even",2),("odd",3)]
K
MK
AV
K