guix-devel
[Top][All Lists]
Advanced

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

Re: 'package-name-version' and 'strip-store-file-name' does the same thi


From: Ludovic Courtès
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi Alex,

Alex Vong <address@hidden> skribis:

> address@hidden (Ludovic Courtès) writes:
>
>> Hello Alex,
>>
>> Alex Vong <address@hidden> 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 ‘flatten’ specifically, I feel like it’s not a good sign in terms
>> of programming style when we end up using it (though we’d need to study
>> these specific use cases), so I’m reluctant to “standardizing” 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 ‘flatten’, they’d
probably be using ‘append’, ‘concatenate’, etc., or perhaps they’re
using the wrong data structure in the first place.  But again, we’d have
to look more closely at the existing use cases to see more concretely to
what extent they could be written differently.

Ludo’.



reply via email to

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