From 5d79992262e8f16a3efa985375be74abea3bb392 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 24 Aug 2018 21:07:11 +0200 Subject: lib.types: add haskell.{conid,modid} --- lib/types.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/types.nix b/lib/types.nix index 572964a..09d403a 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -1,6 +1,19 @@ { lib, ... }: with lib; rec { + + haskell.conid = mkOptionType { + name = "Haskell constructor identifier"; + check = test "[[:upper:]][[:lower:]_[:upper:]0-9']*"; + merge = mergeOneOption; + }; + + haskell.modid = mkOptionType { + name = "Haskell module identifier"; + check = x: isString x && all haskell.conid.check (splitString "." x); + merge = mergeOneOption; + }; + # POSIX.1‐2013, 3.2 Absolute Pathname absolute-pathname = mkOptionType { name = "POSIX absolute pathname"; -- cgit v1.2.3