guix-commits
[Top][All Lists]
Advanced

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

05/06: vm: Use 'fold2' from (guix combinators).


From: Ludovic Courtès
Subject: 05/06: vm: Use 'fold2' from (guix combinators).
Date: Thu, 29 Jun 2017 18:17:55 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit a2278922fe5158d3caac9d2c3ff5008e084a45d3
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jun 30 00:13:54 2017 +0200

    vm: Use 'fold2' from (guix combinators).
    
    * gnu/build/vm.scm: Use (guix combinators).
    (fold2): Remove.
---
 gnu/build/vm.scm | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index d0bc8c3..8f7fc3c 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -27,6 +27,7 @@
   #:use-module (gnu build linux-boot)
   #:use-module (gnu build install)
   #:use-module (guix records)
+  #:use-module ((guix combinators) #:select (fold2))
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
@@ -157,18 +158,6 @@ given by GRAPHS, a list of file names produced by 
#:references-graphs."
   ;; Simply add a 20% overhead.
   (round (* 1.2 (closure-size graphs))))
 
-(define (fold2 proc seed1 seed2 lst)              ;TODO: factorize
-  "Like `fold', but with a single list and two seeds."
-  (let loop ((result1 seed1)
-             (result2 seed2)
-             (lst     lst))
-    (if (null? lst)
-        (values result1 result2)
-        (call-with-values
-            (lambda () (proc (car lst) result1 result2))
-          (lambda (result1 result2)
-            (loop result1 result2 (cdr lst)))))))
-
 (define* (initialize-partition-table device partitions
                                      #:key
                                      (label-type "msdos")



reply via email to

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