all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: 宋文武 <iyzsong@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] profiles: Add gtk-icon-themes hook.
Date: Wed, 27 May 2015 09:50:28 +0200	[thread overview]
Message-ID: <87a8wqjw6z.fsf@gnu.org> (raw)
In-Reply-To: <878uchaz9i.fsf@gmail.com> ("宋文武"'s message of "Fri, 22 May 2015 14:43:05 +0800")

宋文武 <iyzsong@gmail.com> skribis:

[...]

>>> +  (define (manifest-lookup-gtk+ store manifest)
>>> +    "Return the first GTK+ package or store path referenced by MANIFEST entries,
>>> +or #f if not referenced by any entry."
>>> +    (any (cut entry-lookup-gtk+ store <>) (manifest-entries manifest)))
>>
>> This becomes:
>>
>>   (anym %store-monad
>>         (cut entry-lookup-gtk+ store <>)
>>         (manifest-entries manifest))
> This doesn't work, 'anym' need a list of monadic values, I endup with:
>
>   (anym %store-monad
>         (lambda (x) x) ; any better idea?
>         (map entry-lookup-gtk+ (manifest-entries manifest)))

Hmm...  Indeed, ‘anym’, ‘mapm’, and ‘foldm’ had the “wrong” signature:
they took a list of monadic values instead of a list of regular values
as one would normally expect (see
<http://members.chello.nl/hjgtuyl/tourdemonad.html> for instance.)
Fixed in b734996.

So now you can really write:

  (anym %store-monad entry-lookup-gtk+ (manifest-entries manifest))

> From 96381da9c8680e2060e1c13c59698c635498094b Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@gmail.com>
> Date: Sat, 9 May 2015 12:45:39 +0800
> Subject: [PATCH] profiles: Add gtk-icon-themes hook.
>
> * guix/profiles.scm (gtk-icon-themes): New function.
>   (%default-profile-hooks): Add it.

[...]

> @@ -606,7 +684,7 @@ the monadic procedures listed in HOOKS--such as an Info 'dir' file, etc."
>                                                            (hook manifest))
>                                                          hooks)))))
>      (define inputs
> -      (append (map gexp-input extras)
> +      (append (map gexp-input (filter (lambda (x) x) extras))
>                (manifest-inputs manifest)))

The fact that HOOK could return either a monadic value or a regular
value was indeed bad style.  I’ve fixed it in 07eaecf, so now this part
of the patch is no longer needed.

OK to push with these two updates.

Thank you!

Ludo’.

  reply	other threads:[~2015-05-27  7:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13  9:12 [PATCH] profiles: Add gtk-icon-themes hook 宋文武
2015-05-21 16:33 ` Ludovic Courtès
2015-05-22  6:43   ` 宋文武
2015-05-27  7:50     ` Ludovic Courtès [this message]
2015-05-27 13:11       ` 宋文武
2015-05-27 15:25         ` Ludovic Courtès
2015-05-28  3:25         ` Mark H Weaver
2015-05-28 12:42           ` 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=87a8wqjw6z.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=iyzsong@gmail.com \
    /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.