guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] profiles: Add gtk-icon-themes hook.


From: Ludovic Courtès
Subject: Re: [PATCH] profiles: Add gtk-icon-themes hook.
Date: Wed, 27 May 2015 09:50:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

宋文武 <address@hidden> 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?= <address@hidden>
> 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 via email to

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