guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why is "append" the activation service's "compose" procedure?


From: Chris Marusich
Subject: Why is "append" the activation service's "compose" procedure?
Date: Fri, 23 Mar 2018 11:17:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]