unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Marusich <cmmarusich@gmail.com>
To: guix-devel@gnu.org
Subject: Why is "append" the activation service's "compose" procedure?
Date: Fri, 23 Mar 2018 11:17:45 +0100	[thread overview]
Message-ID: <87muyzdrjq.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

Hi,

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?

-- 
Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

             reply	other threads:[~2018-03-23 10:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 10:17 Chris Marusich [this message]
2018-03-26 13:02 ` Why is "append" the activation service's "compose" procedure? Ludovic Courtès
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=87muyzdrjq.fsf@gmail.com \
    --to=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).