Next: , Previous: , Up: Guix REPL   [Contents][Index]


6.1.2 select count packages on criteria

(→ 4 min 20 s into Simon Tournier presentation)

In the following REPL session

REPL session :

$ guix repl
GNU Guile 3.0.8
;;  [skipped licence preamble]
> (use-modules
  (guix)
  (guix build-system haskell)
  (gnu)
  (ice-9 match))
>
> (define haskell-packages
  (fold-packages
    (lambda (package result)
      (if (eq? (package-build-system package) haskell-build-system)
         (cons package result)
         result))
    '()))
> (define (cabal-revision? package)
  (apply (lambda* (#:key cabal-revision #:allow-other-keys)
                  (match cabal-revision
                         ((revision hash) #t)
                         (_ #f)))
         (package-arguments package)))
> (define cabal-revision-packages
  (filter cabal-revision? haskell-packages))
> (length haskell-packages)
$1 = 721
> (length cabal-revision-packages)
$2 = 108