summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/types.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-06-06 21:27:50 +0200
committermakefu <github@syntax-fehler.de>2016-06-06 21:27:50 +0200
commitd587575deb7d6d3c94f684a7b6f6a6a2da0db247 (patch)
tree71dc6d19487bdbc2451a6711e220a7000023c4db /krebs/4lib/types.nix
parent7bbf87d9a4923f15cc04847ad762e4279ee752bf (diff)
parentbaa20586b875e5b6bd600cf731f15d2251d05c95 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'krebs/4lib/types.nix')
-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 56d1d55c..66191d0b 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";