about summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/tag/default.nix15
1 files changed, 14 insertions, 1 deletions
diff --git a/nix/tag/default.nix b/nix/tag/default.nix
index 4fe5898258..23f369c2b2 100644
--- a/nix/tag/default.nix
+++ b/nix/tag/default.nix
@@ -24,6 +24,18 @@ let
       val = null;
     };
 
+  # Returns the tag name of a given tag attribute set.
+  # Throws if the tag is invalid.
+  #
+  # Type: tag -> string
+  tagName = tag: (assertIsTag tag).name;
+
+  # Returns the tagged value of a given tag attribute set.
+  # Throws if the tag is invalid.
+  #
+  # Type: tag -> any
+  tagValue = tag: (assertIsTag tag).val;
+
   # like `verifyTag`, but throws the error message if it is not a tag.
   assertIsTag = tag:
     let res = verifyTag tag; in
@@ -139,7 +151,8 @@ let
 in {
    inherit
      verifyTag
-     assertIsTag
+     tagName
+     tagValue
      discr
      discrDef
      match