diff options
author | tv <tv@krebsco.de> | 2018-08-24 21:07:11 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2018-08-24 21:07:11 +0200 |
commit | 5d79992262e8f16a3efa985375be74abea3bb392 (patch) | |
tree | fefb05a756c92e72852fcaf082c77db821eb11b4 /lib | |
parent | 4d0829328e885a6d7163b513998a975e60dd0a72 (diff) |
lib.types: add haskell.{conid,modid}v1.0.0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/types.nix | 13 |
1 files changed, 13 insertions, 0 deletions
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"; |