all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Alex Vong <alexvong1995@gmail.com>
Cc: guix-devel@gnu.org
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	[thread overview]
Message-ID: <877eicagzn.fsf@gnu.org> (raw)
In-Reply-To: <87d0s5pz9j.fsf@gmail.com> (Alex Vong's message of "Sat, 20 Oct 2018 02:28:08 +0800")

Hi Alex,

Alex Vong <alexvong1995@gmail.com> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>
>> Hello Alex,
>>
>> Alex Vong <alexvong1995@gmail.com> 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	other threads:[~2018-10-20 13:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15 19:26 'package-name-version' and 'strip-store-file-name' does the same thing with different ways Alex Vong
2018-10-16 11:54 ` Ludovic Courtès
2018-10-16 22:04   ` Alex Vong
2018-10-19 13:52     ` Ludovic Courtès
2018-10-19 18:28       ` Alex Vong
2018-10-20 13:24         ` Ludovic Courtès [this message]
2018-10-20  8:37       ` Ricardo Wurmus
2018-10-20 13:57         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877eicagzn.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=alexvong1995@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.