all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Why is "append" the activation service's "compose" procedure?
@ 2018-03-23 10:17 Chris Marusich
  2018-03-26 13:02 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Marusich @ 2018-03-23 10:17 UTC (permalink / raw)
  To: guix-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-29 11:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-23 10:17 Why is "append" the activation service's "compose" procedure? Chris Marusich
2018-03-26 13:02 ` Ludovic Courtès
2018-03-29  7:32   ` Chris Marusich
2018-03-29 11:25     ` Ludovic Courtès

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.