From: ludo@gnu.org (Ludovic Courtès)
To: Chris Marusich <cmmarusich@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: Why is "append" the activation service's "compose" procedure?
Date: Mon, 26 Mar 2018 15:02:36 +0200 [thread overview]
Message-ID: <87zi2vdm6r.fsf@gnu.org> (raw)
In-Reply-To: <87muyzdrjq.fsf@gmail.com> (Chris Marusich's message of "Fri, 23 Mar 2018 11:17:45 +0100")
Hello,
Chris Marusich <cmmarusich@gmail.com> skribis:
> This is our current definition of the activation-service-type (in (gnu
> services)):
>
> (define activation-service-type
> (service-type (name 'activate)
> (extensions
> (list (service-extension boot-service-type
> gexps->activation-gexp)))
> (compose append)
> (extend second-argument)))
>
> Note that the the append procedure is used as the "compose" procedure.
> However, fold-services applies the "compose" procedure to a single list.
> What happens when you apply the append procedure to a single list? You
> get the same list back:
>
> scheme@(guile-user)> (define mylist '(1 2 3))
> scheme@(guile-user)> (append mylist)
> $1 = (1 2 3)
> scheme@(guile-user)> (eq? mylist (append mylist))
> $2 = #t
>
> The fold-services procedure always applies the "compose" procedure to a
> single list. So why does the activation-service-type use the append
> procedure as its "compose" procedure? Wouldn't it more accurately
> reflect our intent if we used the identity procedure instead?
Yes, you’re right here as well. :-)
‘boot-service-type’ has the same problem.
Can you fix both?
Thanks!
Ludo’.
next prev parent reply other threads:[~2018-03-26 13:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 10:17 Why is "append" the activation service's "compose" procedure? Chris Marusich
2018-03-26 13:02 ` Ludovic Courtès [this message]
2018-03-29 7:32 ` Chris Marusich
2018-03-29 11:25 ` Ludovic Courtès
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zi2vdm6r.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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).