lib/types: add types.nonEmptyListOf
This commit is contained in:
parent
e860b651d6
commit
c65e36c9ca
@ -256,6 +256,10 @@ rec {
|
|||||||
functor = (defaultFunctor name) // { wrapped = elemType; };
|
functor = (defaultFunctor name) // { wrapped = elemType; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nonEmptyListOf = elemType:
|
||||||
|
let list = addCheck (types.listOf elemType) (l: l != []);
|
||||||
|
in list // { description = "non-empty " + list.description; };
|
||||||
|
|
||||||
attrsOf = elemType: mkOptionType rec {
|
attrsOf = elemType: mkOptionType rec {
|
||||||
name = "attrsOf";
|
name = "attrsOf";
|
||||||
description = "attribute set of ${elemType.description}s";
|
description = "attribute set of ${elemType.description}s";
|
||||||
|
Loading…
Reference in New Issue
Block a user