From ed56f41ddc1775ef8938befa88dcb7d029bf6450 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 4 Jun 2016 19:06:50 +0200 Subject: krebs types.haskell.{con,mod}id: init --- krebs/4lib/types.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'krebs/4lib') 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, hostname = mkOptionType { name = "hostname"; -- cgit v1.2.3