Skip to content

Commit

Permalink
lib/types: make pattern of strMatching accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjobeki committed Oct 23, 2024
1 parent d2dfc1a commit ad7b2f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,11 @@ rec {
descriptionClass = "noun";
check = x: str.check x && builtins.match pattern x != null;
inherit (str) merge;
functor = defaultFunctor "strMatching" // {
type = payload: strMatching payload.pattern;
payload = { inherit pattern; };
binOp = lhs: rhs: if lhs == rhs then lhs else null;
};
};

# Merge multiple definitions by concatenating them (with the given
Expand Down

0 comments on commit ad7b2f3

Please sign in to comment.