lib/types: add ints.positive.

For values that are positive, but cannot be 0.
This commit is contained in:
Profpatsch
2017-11-05 15:56:32 +01:00
parent 1158910676
commit 462c048c77
5 changed files with 25 additions and 0 deletions
+4
View File
@@ -151,6 +151,10 @@ rec {
name = "unsignedInt";
description = "unsigned integer, meaning >=0";
};
positive = addCheck types.int (x: x > 0) // {
name = "positiveInt";
description = "positive integer, meaning >0";
};
u8 = unsign 8 256;
u16 = unsign 16 65536;
u32 = unsign 32 4294967296;