From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Why is "append" the activation service's "compose" procedure? Date: Fri, 23 Mar 2018 11:17:45 +0100 Message-ID: <87muyzdrjq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ezJle-00048z-4S for guix-devel@gnu.org; Fri, 23 Mar 2018 06:17:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ezJld-0007Iu-E3 for guix-devel@gnu.org; Fri, 23 Mar 2018 06:17:50 -0400 Received: from mail-it0-x231.google.com ([2607:f8b0:4001:c0b::231]:37216) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ezJld-0007Ij-8q for guix-devel@gnu.org; Fri, 23 Mar 2018 06:17:49 -0400 Received: by mail-it0-x231.google.com with SMTP id p67-v6so1962831itc.2 for ; Fri, 23 Mar 2018 03:17:49 -0700 (PDT) Received: from garuda.local ([2601:602:9d02:4725:6495:ba21:1ebe:620a]) by smtp.gmail.com with ESMTPSA id n26sm5552845ioc.80.2018.03.23.03.17.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 23 Mar 2018 03:17:46 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 =3D (1 2 3) scheme@(guile-user)> (eq? mylist (append mylist)) $2 =3D #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? =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlq01EkACgkQ3UCaFdgi Rp1gew/+JHXClmNEMRLbvkaKWfBIncgFIf7fFmR6XnQXsnACqNZrPXjUAuo2iCfb AK1RSuDnXkua1R8nZD9Ocu5CARCjCg6cQDDF/eI4YX7B5auYTVMdXdu39VNMWXyp hgoAfsYh7P6zFIqfEOFN2XgwGbxkKgfSrpHvkG3ztJtumlmCt37TxvFiL5VKAjiy DpMrOXefLbABbdx/FQJ6oeW68kcgwU7iC/+xBISyanXviRFPC87aMMPd9Hc05oTH BcCxm3h02QWR31b9xFnD67JNwFv7f/t41I/RAxQmwiOXIL6rmfg9AKJJrvEQub3H JmblGNND+OkiwoI6zpB3/GguxsLY8IyZMO6vnD2raYdLSQM6wbqzbro+9sKEpZwg QQwDbe7xhDs6daw6GvHpXd4D+vh9D9joVhkNyK48MK+BtjqB3c8R7IUI2cT2iBVF KsZMg1OJC4PWETc36HzZ3ur3a5A1YYKyFUKrBhSxOMC6wgqixupGeokNIpsnCbLQ sjK0SsRGD2sMVAUbBbXj7cvhV8Jgi/rYPOS66SveSf5unB6Sw1LKeVLw0psuRaYq 9AtwAKIwz15I/HR4U2wMlYb6JujWwQcqL3CaNGIKzAsscfL1FxgsVxXNfYOLbSA8 RUKNqhEfu2jwu8TtKGE7wJVCKri5o1YMrPAaMpud3iYRlCDyLIM= =Bocd -----END PGP SIGNATURE----- --=-=-=--