lib: lists: add 'mapFilter'

This commit is contained in:
Bruno BELANYI 2021-08-24 22:25:12 +02:00
parent 11fbbd62eb
commit 4f742b69f2

13
lib/lists.nix Normal file
View file

@ -0,0 +1,13 @@
{ lib, ... }:
let
inherit (lib) filter;
in
{
# Filter a list using a predicate function after applying a map.
#
# mapFilter ::
# (value -> bool)
# (any -> value)
# [ any ]
mapFilter = pred: f: attrs: filter pred (map f attrs);
}