mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-22 20:43:27 +00:00
lib: add RFC-145 nixdoc comments to extended library functions
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I41c4b2cb70512699a044578fa88eb8266a6a6964
This commit is contained in:
parent
63d8fc82d6
commit
a17f043605
7 changed files with 506 additions and 19 deletions
|
|
@ -1,33 +1,34 @@
|
|||
{lib}: let
|
||||
inherit (lib.lists) elem all;
|
||||
in {
|
||||
/*
|
||||
Checks if all values are present in the list.
|
||||
/**
|
||||
Checks if all values are present in the list.
|
||||
|
||||
Type:
|
||||
# Type
|
||||
|
||||
```
|
||||
listContainsValues :: { list :: [a], values :: [a] } -> Bool
|
||||
```
|
||||
|
||||
Arguments:
|
||||
list - A list of elements.
|
||||
values - A list of values to check for presence in the list.
|
||||
# Arguments
|
||||
|
||||
Returns:
|
||||
True if all values are present in the list, otherwise False.
|
||||
- `list`: A list of elements.
|
||||
- `values`: A list of values to check for presence in the list.
|
||||
|
||||
# Example
|
||||
|
||||
Example:
|
||||
```nix
|
||||
listContainsValues { list = [1 2 3]; values = [2 3]; }
|
||||
=> True
|
||||
=> true
|
||||
|
||||
listContainsValues { list = [1 2 3]; values = [2 4]; }
|
||||
=> False
|
||||
=> false
|
||||
```
|
||||
*/
|
||||
listContainsValues = {
|
||||
list,
|
||||
values,
|
||||
}: let
|
||||
# Check if all values are present in the list
|
||||
containsValue = value: elem value list;
|
||||
in
|
||||
all containsValue values;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue