diff options
author | Bruno Victal <mirai@makinata.eu> | 2023-10-07 16:59:09 +0100 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-10-07 12:41:06 -0400 |
commit | 00a28bc435606dc98925fbae1ebe314881f35c90 (patch) | |
tree | 4be9163030bf767f580d9c8dce7a68e3a5b5b18d /gnu/services/configuration.scm | |
parent | 3872ecf274ca53a5c195f6b51081474876897565 (diff) |
services: configuration: Add some commonly used predicates.
* gnu/services/configuration.scm (list-of-packages?, list-of-symbols?): New
predicate.
* gnu/services/audio.scm (list-of-symbol?): Remove.
* gnu/services/telephony.scm (string-list?): Remove.
(serialize-string-list): Rename to …
(serialize-list-of-strings): … this.
(account-fingerprint-list?, jami-account-list?): Use list-of.
* doc/guix.texi: Update it.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/services/configuration.scm')
-rw-r--r-- | gnu/services/configuration.scm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index aa5fb832d57..d2b1687496c 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -80,7 +80,9 @@ interpose list-of + list-of-packages? list-of-strings? + list-of-symbols? alist? serialize-file-like text-config? @@ -500,6 +502,11 @@ DELIMITER interposed LS. Support 'infix and 'suffix GRAMMAR values." (cons delimiter acc)))) '() ls)) + +;;; +;;; Commonly used predicates +;;; + (define (list-of pred?) "Return a procedure that takes a list and check if all the elements of the list result in @code{#t} when applying PRED? on them." @@ -508,10 +515,20 @@ the list result in @code{#t} when applying PRED? on them." (every pred? x) #f))) +(define list-of-packages? + (list-of package?)) (define list-of-strings? (list-of string?)) +(define list-of-symbols? + (list-of symbol?)) + + +;;; +;;; Special serializers +;;; + (define alist? (list-of pair?)) |