From: ludo@gnu.org (Ludovic Courtès)
To: Chris Marusich <cmmarusich@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: Incorrect service documentation?
Date: Mon, 26 Mar 2018 14:57:16 +0200 [thread overview]
Message-ID: <878taff103.fsf@gnu.org> (raw)
In-Reply-To: <87r2obdrxd.fsf@gmail.com> (Chris Marusich's message of "Fri, 23 Mar 2018 11:09:34 +0100")
Hello!
Chris Marusich <cmmarusich@gmail.com> skribis:
> Is the description of "compose" correct? The manual claims that it
> "must return a value that is a valid parameter value for the service
> instance," but I do not think that is actually true. Judging by the
> implementation of fold-services in (gnu services), it may return any
> single value as long as the extend procedure knows how to handle it. In
> fact, it is the "extend" procedure which must return a valid parameter
> value for the service.
Yes, you’re right! Good catch.
> If this is true, then I suggest we change the documentation as follows:
>
> ‘compose’ (default: ‘#f’)
> If this is ‘#f’, then the service type denotes services that
> cannot be extended—i.e., services that do not receive “values”
> from other services.
>
> Otherwise, it must be a one-argument procedure. The procedure
> is called by ‘fold-services’ and is passed a list of values
> collected from extensions. It may return any single value.
>
> ‘extend’ (default: ‘#f’)
> If this is ‘#f’, services of this type cannot be extended.
>
> Otherwise, it must be a two-argument procedure:
> ‘fold-services’ calls it, passing it the initial value of the
> service as the first argument and the result of applying
> ‘compose’ to the extension values as the second argument. It
> must return a value that is a valid parameter value for the
> service instance.
>
> What do you think?
LGTM!
Thank you,
Ludo’.
next prev parent reply other threads:[~2018-03-26 12:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 10:09 Incorrect service documentation? Chris Marusich
2018-03-26 12:57 ` Ludovic Courtès [this message]
2018-03-29 5:38 ` Chris Marusich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878taff103.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=cmmarusich@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.