grafts: Remove unused variables and confusing monad use.

* guix/grafts.scm (cumulative-grafts)[return/cache]: Use %STATE-MONAD,
not %STORE-MONAD.
Remove unused 'origins' variable and unnecessary inner 'cache'
variable.
This commit is contained in:
Ludovic Courtès 2016-10-15 16:38:07 +02:00
parent 5f01e1bbc6
commit 783ae212c2
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -253,7 +253,7 @@ (define (dependency-grafts item)
(state-return grafts))))
(define (return/cache cache value)
(mbegin %store-monad
(mbegin %state-monad
(set-current-state (vhash-consq drv value cache))
(return value)))
@ -266,10 +266,8 @@ (define (return/cache cache value)
(() ;no dependencies
(return/cache cache grafts))
(deps ;one or more dependencies
(mlet %state-monad ((grafts (mapm %state-monad dependency-grafts deps))
(cache (current-state)))
(let* ((grafts (delete-duplicates (concatenate grafts) equal?))
(origins (map graft-origin-file-name grafts)))
(mlet %state-monad ((grafts (mapm %state-monad dependency-grafts deps)))
(let ((grafts (delete-duplicates (concatenate grafts) equal?)))
(match (filter (lambda (graft)
(member (graft-origin-file-name graft) deps))
grafts)