From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: 'package-name-version' and 'strip-store-file-name' does the same thing with different ways Date: Sat, 20 Oct 2018 15:24:12 +0200 Message-ID: <877eicagzn.fsf@gnu.org> References: <875zy3j9k9.fsf@gmail.com> <874ldmgl8p.fsf@gnu.org> <87a7ndfszf.fsf@gmail.com> <877eiegi2m.fsf@gnu.org> <87d0s5pz9j.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDrEl-0007Tk-Ry for guix-devel@gnu.org; Sat, 20 Oct 2018 09:24:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDrEk-0003DO-8R for guix-devel@gnu.org; Sat, 20 Oct 2018 09:24:15 -0400 In-Reply-To: <87d0s5pz9j.fsf@gmail.com> (Alex Vong's message of "Sat, 20 Oct 2018 02:28:08 +0800") 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: Alex Vong Cc: guix-devel@gnu.org Hi Alex, Alex Vong skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Hello Alex, >> >> Alex Vong skribis: >> >>> Btw, I also noticed that the procedure 'flatten' are defined in >>> (gnu services telephony), (gnu services web) and (guix import utils). >>> [I was about to define my own version of it...] >>> I like the version using 'fold-right' together with 'match-lambda*' the >>> most. Should we move it (guix build utils) and remove the rest? >> >> About =E2=80=98flatten=E2=80=99 specifically, I feel like it=E2=80=99s n= ot a good sign in terms >> of programming style when we end up using it (though we=E2=80=99d need t= o study >> these specific use cases), so I=E2=80=99m reluctant to =E2=80=9Cstandard= izing=E2=80=9D it. :-) >> > Your comment lead me to find out that 'append-map' is actually what I > want. I am curious why it is an indication of bad style. My intuition is that often, when one feels a need for =E2=80=98flatten=E2= =80=99, they=E2=80=99d probably be using =E2=80=98append=E2=80=99, =E2=80=98concatenate=E2=80=99, = etc., or perhaps they=E2=80=99re using the wrong data structure in the first place. But again, we=E2=80=99d= have to look more closely at the existing use cases to see more concretely to what extent they could be written differently. Ludo=E2=80=99.