Subject: Re: bug#45692: [PATCH 0/4] Even Better ZFS Support on Guix

From: Ludovic Courtès <[email-masked]>
Date: Wed, 10 Feb 2021 15:13:19 +0100

raid5atemyhomework <[email-masked]> skribis:

> +(define (kernel-builder-configuration->system-entry config)
> +  "Return the kernel and hurd entries of the 'system' directory."
> +  (mbegin %store-monad
> +    (let* ((kernel  (kernel-builder-configuration-kernel config))
> +           (hurd    (kernel-builder-configuration-hurd config))
> +           (modules (kernel-builder-configuration-modules config))
> +           (kernel  (if hurd
> +                        kernel
> +                        (profile
> +                         (content (packages->manifest
> +                                   (cons kernel
> +                                         (map (lambda (module)
> +                                                (if (package? module)
> +                                                    (package-for-kernel kernel module)
> +                                                    module))
> +                                              modules))))
> +                         (hooks (list linux-module-database))))))
> +      (return `(("kernel" ,kernel)
> +                ,@(if hurd `(("hurd" ,hurd)) '()))))))

It may be clearer to avoid ‘mbegin’ and instead write it this way:

  (define (kernel-builder-configuration-modules config)
    (let* …
      (with-monad %store-monad
        (return …))))

Both work but I find this variant slightly clearer.

Ludo’.