summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-04 19:06:50 +0200
committertv <tv@krebsco.de>2016-06-04 19:06:50 +0200
commited56f41ddc1775ef8938befa88dcb7d029bf6450 (patch)
tree3a90f0e20660fbb682587a31960125f0b46c483a
parent309d6f3102b2ea95fb598af7030e559bb28f961b (diff)
krebs types.haskell.{con,mod}id: init
-rw-r--r--krebs/4lib/types.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix
index 56d1d55c3..66191d0b3 100644
--- a/krebs/4lib/types.nix
+++ b/krebs/4lib/types.nix
@@ -286,6 +286,19 @@ types // rec {
};
};
+ haskell.conid = mkOptionType {
+ name = "Haskell constructor identifier";
+ check = x:
+ isString x && match "[[:upper:]][[:lower:]_[:upper:]0-9']*" x != null;
+ merge = mergeOneOption;
+ };
+
+ haskell.modid = mkOptionType {
+ name = "Haskell module identifier";
+ check = x: isString x && all haskell.conid.check (splitString "." x);
+ merge = mergeOneOption;
+ };
+
# RFC952, B. Lexical grammar, <hname>
hostname = mkOptionType {
name = "hostname";