gnu: Add ghc-cereal-conduit.
[jackhill/guix/guix.git] / gnu / packages / haskell.scm
index a373de8..a8d22a6 100644 (file)
@@ -43,6 +43,7 @@
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages graphviz)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages haskell-check)
   #:use-module (gnu packages haskell-crypto)
   #:use-module (gnu packages haskell-web)
@@ -872,10 +873,70 @@ and an alternative to newtype-th.")
 efficient memo functions using tries.")
     (license license:bsd-3)))
 
+(define-public ghc-tree-diff
+  (package
+    (name "ghc-tree-diff")
+    (version "0.0.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/tree-diff/tree-diff-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "049v44c520jy3icxlnrvbdblh3mjmvd7m6qmkzxbzkf02x63xqmz"))))
+    (build-system haskell-build-system)
+    (arguments
+     `(#:cabal-revision
+       ("4" "1rqxxyj6hqllahs11693g855cxz8mgnb490s7j1ksd300i5xgjsp")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'update-constraints
+           (lambda _
+             (substitute* "tree-diff.cabal"
+               (("trifecta             >=1\\.7\\.1\\.1  && <1\\.8")
+                "trifecta             >=1.7.1.1  && <=2")))))))
+    (inputs
+     `(("ghc-aeson" ,ghc-aeson)
+       ("ghc-ansi-wl-pprint" ,ghc-ansi-wl-pprint)
+       ("ghc-ansi-terminal" ,ghc-ansi-terminal)
+       ("ghc-base-compat" ,ghc-base-compat)
+       ("ghc-generics-sop" ,ghc-generics-sop)
+       ("ghc-hashable" ,ghc-hashable)
+       ("ghc-memotrie" ,ghc-memotrie)
+       ("ghc-parsec" ,ghc-parsec)
+       ("ghc-parsers" ,ghc-parsers)
+       ("ghc-quickcheck" ,ghc-quickcheck)
+       ("ghc-scientific" ,ghc-scientific)
+       ("ghc-tagged" ,ghc-tagged)
+       ("ghc-text" ,ghc-text)
+       ("ghc-unordered-containers" ,ghc-unordered-containers)
+       ("ghc-uuid-types" ,ghc-uuid-types)
+       ("ghc-vector" ,ghc-vector)))
+    (native-inputs
+     `(("ghc-base-compat" ,ghc-base-compat)
+       ("ghc-quickcheck" ,ghc-quickcheck)
+       ("ghc-ansi-terminal" ,ghc-ansi-terminal)
+       ("ghc-ansi-wl-pprint" ,ghc-ansi-wl-pprint)
+       ("ghc-parsec" ,ghc-parsec)
+       ("ghc-trifecta" ,ghc-trifecta)
+       ("ghc-tasty" ,ghc-tasty)
+       ("ghc-tasty-golden" ,ghc-tasty-golden)
+       ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck)))
+    (home-page "https://github.com/phadej/tree-diff")
+    (synopsis "Compute difference between (expression) trees")
+    (description "This Haskell library provides a function for computing
+the difference bewteen (expression) trees.  It also provides a way to
+compute the difference between arbitrary abstract datatypes (ADTs) using
+@code{Generics}-derivable helpers.")
+    (license license:bsd-3)))
+
 (define-public ghc-haddock-library
   (package
     (name "ghc-haddock-library")
-    (version "1.4.3")
+    (version "1.5.0.1")
     (source
      (origin
        (method url-fetch)
@@ -885,14 +946,37 @@ efficient memo functions using tries.")
              ".tar.gz"))
        (sha256
         (base32
-         "0ns4bpf6whmcfl0cm2gx2c73if416x4q3ac4l4qm8w84h0zpcr7p"))))
+         "1cmbg8l5xrwpliclwy3l057raypjqy0hsg1h1743ahaj8gq10b7z"))
+       (patches (search-patches
+                 "ghc-haddock-library-unbundle.patch"))
+       (modules '((guix build utils)))
+       (snippet '(begin
+                   (delete-file-recursively "vendor")
+                   #t))))
     (build-system haskell-build-system)
-    (inputs
-     `(("ghc-base-compat" ,ghc-base-compat)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'relax-test-suite-dependencies
+           (lambda _
+             (substitute* "haddock-library.cabal"
+               (("base-compat\\s*\\^>= 0\\.9\\.3") "base-compat")
+               (("hspec\\s*\\^>= 2\\.4\\.4") "hspec"))))
+         ;; The release tarball does not contain the "fixtures/examples"
+         ;; directory, which is required for testing.  In the upstream
+         ;; repository, the directory exists and is populated.  Here, we
+         ;; create an empty directory to placate the tests.
+         (add-before 'check 'add-examples-directory
+           (lambda _
+             (mkdir "fixtures/examples")
+             #t)))))
     (native-inputs
-     `(("hspec-discover" ,hspec-discover)
+     `(("ghc-base-compat" ,ghc-base-compat)
        ("ghc-hspec" ,ghc-hspec)
-       ("ghc-quickcheck" ,ghc-quickcheck)))
+       ("ghc-optparse-applicative" ,ghc-optparse-applicative)
+       ("ghc-quickcheck" ,ghc-quickcheck)
+       ("ghc-tree-diff" ,ghc-tree-diff)
+       ("hspec-discover" ,hspec-discover)))
     (home-page "https://www.haskell.org/haddock/")
     (synopsis "Library exposing some functionality of Haddock")
     (description
@@ -906,8 +990,7 @@ the ‘haddock’ package.")
 (define-public ghc-haddock-api
   (package
     (name "ghc-haddock-api")
-    ;; This is the last version to be supported by Cabal < 2.0
-    (version "2.17.4")
+    (version "2.19.0.1")
     (source
      (origin
        (method url-fetch)
@@ -917,8 +1000,18 @@ the ‘haddock’ package.")
              ".tar.gz"))
        (sha256
         (base32
-         "00fn6pzgg8xjbaw12d76jdqh2dbc5xy7miyz0x6kidvvar7i35ss"))))
+         "0c6i7sljp7myz25d90gyw68a90i5jcrkajkxcciikp2hjirfaas3"))))
     (build-system haskell-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'update-constraints
+           (lambda _
+             (substitute* "haddock-api.cabal"
+               (("Cabal           \\^>= 2\\.0\\.0")
+                "Cabal           ^>= 2.2.0")
+               (("hspec           \\^>= 2\\.4\\.4")
+                "hspec            >= 2.4.4 && < 2.6")))))))
     (inputs
      `(("ghc-paths" ,ghc-paths)
        ("ghc-haddock-library" ,ghc-haddock-library)))
@@ -957,7 +1050,7 @@ documentation-generation tool for Haskell libraries.")
 (define-public ghc-haddock
   (package
     (name "ghc-haddock")
-    (version "2.17.4")
+    (version "2.19.0.1")
     (source
      (origin
        (method url-fetch)
@@ -967,16 +1060,37 @@ documentation-generation tool for Haskell libraries.")
              ".tar.gz"))
        (sha256
         (base32
-         "1z3h3v7w84dzsm47iavdppc2w899mr4c1agq9fzghgz902i0a655"))))
+         "1g1j9j0hf2yhyyh0gwz6bzbvfvliqz9x8a8hnkmwghm7w3xa6sb7"))))
     (build-system haskell-build-system)
-    ;; FIXME: Tests fail with this error:
-    ;; driver-test/Main.hs:4:1: error:
-    ;; Failed to load interface for ‘ResponseFileSpec’
-    (arguments `(#:tests? #f))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; There are four test suites that require the ghc-haddock-test
+         ;; package, which no longer builds with GHC 8.4.3.  This phase
+         ;; removes these four test suites from the Cabal file, so that we
+         ;; do not need ghc-haddock-test as an input.
+         (add-before 'configure 'remove-haddock-test-test-suites
+           (lambda _
+             (use-modules (ice-9 rdelim))
+             (with-atomic-file-replacement "haddock.cabal"
+               (lambda (in out)
+                 (let loop ((line (read-line in 'concat)) (deleting? #f))
+                   (cond
+                    ((eof-object? line) #t)
+                    ((string-every char-set:whitespace line)
+                     (unless deleting? (display line out))
+                     (loop (read-line in 'concat) #f))
+                    ((member line '("test-suite html-test\n"
+                                    "test-suite hypsrc-test\n"
+                                    "test-suite latex-test\n"
+                                    "test-suite hoogle-test\n"))
+                     (loop (read-line in 'concat) #t))
+                    (else
+                     (unless deleting? (display line out))
+                     (loop (read-line in 'concat) deleting?)))))))))))
     (inputs `(("ghc-haddock-api" ,ghc-haddock-api)))
     (native-inputs
-     `(("ghc-hspec" ,ghc-hspec)
-       ("ghc-haddock-test" ,ghc-haddock-test)))
+     `(("ghc-hspec" ,ghc-hspec)))
     (home-page "https://www.haskell.org/haddock/")
     (synopsis
      "Documentation-generation tool for Haskell libraries")
@@ -2691,9 +2805,14 @@ isn't available, portable implementations are used.")
                (base32
                 "1ly3v41jacc6lrsvg4j3m5a6zs90gr8dyif5m6bf34hj1k5cgg0n"))))
     (build-system haskell-build-system)
+    ;; This package needs an older version of tasty.
+    (arguments '(#:tests? #f))
     (inputs
      `(("ghc-parsec" ,ghc-parsec)
        ("ghc-concatenative" ,ghc-concatenative)))
+    (native-inputs
+     `(("ghc-tasty" ,ghc-tasty)
+       ("ghc-tasty-hunit" ,ghc-tasty-hunit)))
     (home-page "http://patch-tag.com/r/salazar/indents")
     (synopsis "Indentation sensitive parser-combinators for parsec")
     (description
@@ -2885,6 +3004,17 @@ Haskell library @code{regex-base}.")
         (base32
          "1sjkpkgv4phy5b5v2lr89x4vx4dh44pj0sbvlsp6n86w9v6v4jwb"))))
     (build-system haskell-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'relax-dependencies
+           (lambda _
+             (substitute* "regex.cabal"
+               (("base-compat.*>=.*0.6.*")
+                "base-compat >= 0.6\n")
+               (("template-haskell.*>=.*2.7.*")
+                "template-haskell >= 2.7\n"))
+             #t)))))
     (inputs
      `(("ghc-base-compat" ,ghc-base-compat)
        ("ghc-hashable" ,ghc-hashable)
@@ -4434,7 +4564,7 @@ system.")
 (define-public ghc-base-compat
   (package
     (name "ghc-base-compat")
-    (version "0.9.3")
+    (version "0.10.4")
     (source
      (origin
        (method url-fetch)
@@ -4444,7 +4574,7 @@ system.")
              ".tar.gz"))
        (sha256
         (base32
-         "0452l6zf6fjhy4kxqwv6i6hhg6yfx4wcg450k3axpyj30l7jnq3x"))))
+         "0ksp990gxs731mq19rzbxrbs43nazfljjc8krlx5bjqblw3kfs8d"))))
     (build-system haskell-build-system)
     (native-inputs
      `(("ghc-quickcheck" ,ghc-quickcheck)
@@ -5644,25 +5774,6 @@ pandoc to represent structured documents.  It also provides functions for
 building up, manipulating and serialising @code{Pandoc} structures.")
     (license license:bsd-3)))
 
-(define-public ghc-pandoc-types-for-pandoc-1
-  (package (inherit ghc-pandoc-types)
-    (version "1.17.0.5")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "https://hackage.haskell.org/package/"
-                                  "pandoc-types/pandoc-types-"
-                                  version ".tar.gz"))
-              (sha256
-               (base32
-                "1csipjdq00iiq77k2wlrg4i7afrzlh8nl585q785xzw7nn45b0n8"))))
-    (arguments
-     `(#:configure-flags (list "--allow-newer=QuickCheck"
-                               "--allow-newer=HUnit")))
-    (inputs
-     `(("ghc-syb" ,ghc-syb)
-       ("ghc-aeson" ,ghc-aeson-for-pandoc-1)
-       ("ghc-string-qq" ,ghc-string-qq)))))
-
 (define-public ghc-texmath
   (package
     (name "ghc-texmath")
@@ -5695,26 +5806,6 @@ markup formats).  The TeX reader supports basic LaTeX and AMS extensions, and
 it can parse and apply LaTeX macros.")
     (license license:gpl2+)))
 
-(define-public ghc-texmath-for-pandoc-1
-  (package (inherit ghc-texmath)
-    (version "0.9.4.4")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "https://hackage.haskell.org/package/"
-                                  "texmath/texmath-" version ".tar.gz"))
-              (sha256
-               (base32
-                "129q33m56diiv35kdwfb07838wrg0mm88kxdqxfyl1zvf9nzkqkd"))))
-    (inputs
-     `(("ghc-network-uri" ,ghc-network-uri)
-       ("ghc-pandoc-types" ,ghc-pandoc-types-for-pandoc-1)
-       ("ghc-parsec" ,ghc-parsec)
-       ("ghc-split" ,ghc-split)
-       ("ghc-syb" ,ghc-syb)
-       ("ghc-temporary" ,ghc-temporary)
-       ("ghc-utf8-string" ,ghc-utf8-string)
-       ("ghc-xml" ,ghc-xml)))))
-
 (define-public ghc-regex-pcre-builtin
   (package
     (name "ghc-regex-pcre-builtin")
@@ -6269,12 +6360,6 @@ back-ends.")
      "This package provides a library to parse and render YAML documents.")
     (license license:bsd-3)))
 
-(define-public ghc-yaml-for-pandoc-1
-  (package (inherit ghc-yaml)
-    (inputs
-     `(("ghc-aeson" ,ghc-aeson-for-pandoc-1)
-       ,@(alist-delete "ghc-aeson" (package-inputs ghc-yaml))))))
-
 (define-public ghc-filemanip
   (package
     (name "ghc-filemanip")
@@ -6376,27 +6461,6 @@ TIFF and GIF formats.")
 described in @url{https://www.lua.org/}.")
     (license license:expat)))
 
-(define-public ghc-hslua-for-pandoc-1
-  (package (inherit ghc-hslua)
-    (version "0.4.1")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "https://hackage.haskell.org/package/"
-                                  "hslua/hslua-" version ".tar.gz"))
-              (sha256
-               (base32
-                "0gqp6qhp4v24kzv2j49kgk7bxqzw0w10x0zr0r2j9wkfavqb9wid"))))
-    (inputs
-     `(("lua" ,lua-5.1)
-       ("ghc-text" ,ghc-text)))
-    (native-inputs
-     `(("ghc-quickcheck" ,ghc-quickcheck)
-       ("ghc-quickcheck-instances" ,ghc-quickcheck-instances)
-       ("ghc-hspec" ,ghc-hspec)
-       ("ghc-hspec-contrib" ,ghc-hspec-contrib)
-       ("ghc-hunit" ,ghc-hunit)
-       ("hspec-discover" ,hspec-discover)))))
-
 (define-public ghc-hslua-module-text
   (package
     (name "ghc-hslua-module-text")
@@ -6650,56 +6714,6 @@ provided.  Skylighting is intended to be the successor to highlighting-kate.")
      `(("ghc-skylighting-core" ,ghc-skylighting-core)
        ,@(package-inputs ghc-skylighting-core)))))
 
-(define-public ghc-skylighting-for-pandoc-1
-  (package (inherit ghc-skylighting)
-    (version "0.1.1.5")
-    (source (origin
-              (method git-fetch)
-              ;; We take the sources from Github, because the tarball on
-              ;; hackage does not include the XML files.
-              (uri (git-reference
-                    (url "https://github.com/jgm/skylighting.git")
-                    (commit version)))
-              (file-name (string-append "ghc-skylighting-" version "-checkout"))
-              (sha256
-               (base32
-                "0z3yv8v2fqqgv6lsf0ff3ld0h2vkg97b2jiry9wn2f1rizwdqmzl"))))
-    (arguments
-     `(#:configure-flags '("-fbootstrap")
-       #:phases
-       (modify-phases %standard-phases
-         ;; After building the skylighting-extract tool we use it to generate
-         ;; syntax source files from the included XML files.  These are then
-         ;; added to the skylighting.cabal file.
-         (add-after 'build 'extract-xml
-           (lambda _
-             (make-file-writable "skylighting.cabal")
-             (apply invoke "./dist/build/skylighting-extract/skylighting-extract"
-                    (find-files "xml" "\\.xml$"))
-             #t))
-         ;; Reconfigure without bootstrap flag
-         (add-after 'extract-xml 'configure-again
-           (lambda* (#:key outputs inputs tests? #:allow-other-keys)
-             ((assoc-ref %standard-phases 'configure)
-              #:outputs outputs
-              #:inputs inputs
-              #:tests? tests?
-              #:configure-flags '("-f-bootstrap"))))
-         (add-after 'configure-again 'build-again
-           (assoc-ref %standard-phases 'build)))))
-    (inputs
-     `(("ghc-aeson" ,ghc-aeson-for-pandoc-1)
-       ("ghc-ansi-terminal" ,ghc-ansi-terminal)
-       ("ghc-blaze-html" ,ghc-blaze-html)
-       ("ghc-case-insensitive" ,ghc-case-insensitive)
-       ("ghc-diff" ,ghc-diff)
-       ("ghc-hxt" ,ghc-hxt)
-       ("ghc-pretty-show" ,ghc-pretty-show)
-       ("ghc-regex-pcre-builtin" ,ghc-regex-pcre-builtin)
-       ("ghc-safe" ,ghc-safe)
-       ("ghc-text" ,ghc-text)
-       ("ghc-utf8-string" ,ghc-utf8-string)))))
-
 (define-public ghc-doctemplates
   (package
     (name "ghc-doctemplates")
@@ -6731,29 +6745,6 @@ provided.  Skylighting is intended to be the successor to highlighting-kate.")
      "This package provides a simple text templating system used by pandoc.")
     (license license:bsd-3)))
 
-(define-public ghc-doctemplates-for-pandoc-1
-  (package (inherit ghc-doctemplates)
-    (version "0.1.0.2")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://hackage.haskell.org/package/"
-                           "doctemplates/doctemplates-"
-                           version ".tar.gz"))
-       (sha256
-        (base32
-         "0swal6rjya1293mwvl63jch5fx9ghpsil7qs4v7rpansa0izalmp"))))
-    (build-system haskell-build-system)
-    (inputs
-     `(("ghc-aeson" ,ghc-aeson-for-pandoc-1)
-       ("ghc-blaze-markup" ,ghc-blaze-markup)
-       ("ghc-blaze-html" ,ghc-blaze-html)
-       ("ghc-text" ,ghc-text)
-       ("ghc-vector" ,ghc-vector)
-       ("ghc-parsec" ,ghc-parsec)
-       ("ghc-unordered-containers" ,ghc-unordered-containers)
-       ("ghc-scientific" ,ghc-scientific)))))
-
 (define-public ghc-pandoc
   (package
     (name "ghc-pandoc")
@@ -6767,6 +6758,20 @@ provided.  Skylighting is intended to be the successor to highlighting-kate.")
         (base32
          "1dqin92w513l7whg5wdgrngnxsj5mb8gppfvn7kjgyv2pdgpy0zy"))))
     (build-system haskell-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'update-constraints
+           (lambda _
+             (substitute* "pandoc.cabal"
+               (("tasty >= 0\\.11 && < 1\\.1")
+                "tasty >= 0.11 && < 1.1.1"))))
+         (add-before 'configure 'patch-tests
+           (lambda _
+             ;; These tests fail benignly and have been adjusted upstream:
+             ;; <https://github.com/commercialhaskell/stackage/issues/3719>.
+             (substitute* "test/Tests/Old.hs"
+               (("lhsWriterTests \"html\"") "[]")))))))
     (inputs
      `(("ghc-aeson" ,ghc-aeson)
        ("ghc-aeson-pretty" ,ghc-aeson-pretty)
@@ -6829,66 +6834,6 @@ definition lists, tables, and other features.  A compatibility mode is
 provided for those who need a drop-in replacement for Markdown.pl.")
     (license license:gpl2+)))
 
-;; This is the last version of Pandoc 1.x, which is preferred for Rmarkdown.
-(define-public ghc-pandoc-1
-  (package (inherit ghc-pandoc)
-    (version "1.19.2.4")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://hackage.haskell.org/package/pandoc/pandoc-"
-                           version ".tar.gz"))
-       (sha256
-        (base32
-         "0mim429mpakrcnm50csxyqk3ljcx2l26r5grk6w9isnggwgqrq5v"))))
-    (arguments
-     `(#:configure-flags (list "--allow-newer=skylighting")))
-    (inputs
-     `(("ghc-aeson" ,ghc-aeson-for-pandoc-1)
-       ("ghc-ansi-terminal" ,ghc-ansi-terminal)
-       ("ghc-base64-bytestring" ,ghc-base64-bytestring)
-       ("ghc-blaze-html" ,ghc-blaze-html)
-       ("ghc-blaze-markup" ,ghc-blaze-markup)
-       ("ghc-cmark" ,ghc-cmark)
-       ("ghc-data-default" ,ghc-data-default)
-       ("ghc-deepseq-generics" ,ghc-deepseq-generics)
-       ("ghc-diff" ,ghc-diff)
-       ("ghc-doctemplates" ,ghc-doctemplates-for-pandoc-1)
-       ("ghc-executable-path" ,ghc-executable-path)
-       ("ghc-extensible-exceptions" ,ghc-extensible-exceptions)
-       ("ghc-filemanip" ,ghc-filemanip)
-       ("ghc-haddock-library" ,ghc-haddock-library)
-       ("ghc-hslua" ,ghc-hslua-for-pandoc-1)
-       ("ghc-http" ,ghc-http)
-       ("ghc-http-client" ,ghc-http-client)
-       ("ghc-http-client-tls" ,ghc-http-client-tls)
-       ("ghc-http-types" ,ghc-http-types)
-       ("ghc-juicypixels" ,ghc-juicypixels)
-       ("ghc-network" ,ghc-network)
-       ("ghc-network-uri" ,ghc-network-uri)
-       ("ghc-old-time" ,ghc-old-time)
-       ("ghc-pandoc-types" ,ghc-pandoc-types-for-pandoc-1)
-       ("ghc-parsec" ,ghc-parsec)
-       ("ghc-random" ,ghc-random)
-       ("ghc-scientific" ,ghc-scientific)
-       ("ghc-sha" ,ghc-sha)
-       ("ghc-skylighting" ,ghc-skylighting-for-pandoc-1)
-       ("ghc-syb" ,ghc-syb)
-       ("ghc-tagsoup" ,ghc-tagsoup)
-       ("ghc-temporary" ,ghc-temporary)
-       ("ghc-texmath" ,ghc-texmath-for-pandoc-1)
-       ("ghc-text" ,ghc-text)
-       ("ghc-unordered-containers" ,ghc-unordered-containers)
-       ("ghc-vector" ,ghc-vector)
-       ("ghc-xml" ,ghc-xml)
-       ("ghc-yaml" ,ghc-yaml-for-pandoc-1)
-       ("ghc-zip-archive" ,ghc-zip-archive)
-       ("ghc-zlib" ,ghc-zlib)))
-    (native-inputs
-     `(("ghc-test-framework" ,ghc-test-framework)
-       ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
-       ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)))))
-
 (define-public ghc-hs-bibutils
   (package
     (name "ghc-hs-bibutils")
@@ -7080,6 +7025,13 @@ the @code{conduit} package.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         ;; Many YAML tests (44) are failing do to changes in ghc-yaml:
+         ;; <https://github.com/jgm/pandoc-citeproc/issues/342>.
+         (add-before 'configure 'patch-tests
+           (lambda _
+             (substitute* "tests/test-pandoc-citeproc.hs"
+               (("let allTests = citeprocTests \\+\\+ biblio2yamlTests")
+                "let allTests = citeprocTests"))))
          ;; Tests need to be run after installation.
          (delete 'check)
          (add-after 'install 'post-install-check
@@ -7117,19 +7069,6 @@ and also has a mode for converting bibliographic databases a YAML format
 suitable for inclusion in pandoc YAML metadata.")
     (license license:bsd-3)))
 
-(define-public ghc-pandoc-citeproc-with-pandoc-1
-  (let ((for-pandoc-1
-         (package-input-rewriting
-          `((,ghc-aeson        . ,ghc-aeson-for-pandoc-1)
-            (,ghc-yaml         . ,ghc-yaml-for-pandoc-1)
-            (,ghc-texmath      . ,ghc-texmath-for-pandoc-1)
-            (,ghc-pandoc-types . ,ghc-pandoc-types-for-pandoc-1)
-            (,ghc-hslua        . ,ghc-hslua-for-pandoc-1)
-            (,ghc-skylighting  . ,ghc-skylighting-for-pandoc-1)
-            (,ghc-doctemplates . ,ghc-doctemplates-for-pandoc-1)
-            (,ghc-pandoc       . ,ghc-pandoc-1)))))
-    (for-pandoc-1 ghc-pandoc-citeproc)))
-
 (define-public ghc-union-find
   (package
     (name "ghc-union-find")
@@ -8207,6 +8146,7 @@ helper functions for Lists, Maybes, Tuples, Functions.")
        ("ghc-utility-ht" ,ghc-utility-ht)
        ("ghc-data-accessor-transformers" ,ghc-data-accessor-transformers)
        ("ghc-data-accessor" ,ghc-data-accessor)
+       ("ghc-semigroups" ,ghc-semigroups)
        ("gnuplot" ,gnuplot)))
     (arguments
      `(#:phases
@@ -8411,6 +8351,14 @@ Rust syntax.  It is intended to be useful for two different purposes:
         (base32
           "03zycmwrchhqvi37fdvlzz2d1vl4hy0i8xyys1zznw38qfq0h2i5"))))
     (build-system haskell-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'update-constraints
+           (lambda _
+             (substitute* "wave.cabal"
+               (("temporary.* < 1\\.3")
+                "temporary >= 1.1 && < 1.4")))))))
     (inputs
      `(("ghc-cereal" ,ghc-cereal)
        ("ghc-data-default-class"
@@ -8495,60 +8443,88 @@ JSON (JavaScript Object Notation) is a lightweight data-interchange format.")
     (license license:bsd-3)))
 
 (define-public ghc-esqueleto
-  (package
-    (name "ghc-esqueleto")
-    (version "2.5.3")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "https://hackage.haskell.org/package/"
-                           "esqueleto/esqueleto-" version ".tar.gz"))
-       (sha256
-        (base32
-         "10n49rzqmblky7pwjnysalyy6nacmxfms8dqbsdv6hlyzr8pb69x"))))
-    (build-system haskell-build-system)
-    (inputs
-     `(("ghc-blaze-html" ,ghc-blaze-html)
-       ("ghc-conduit" ,ghc-conduit)
-       ("ghc-monad-logger" ,ghc-monad-logger)
-       ("ghc-persistent" ,ghc-persistent)
-       ("ghc-resourcet" ,ghc-resourcet)
-       ("ghc-tagged" ,ghc-tagged)
-       ("ghc-text" ,ghc-text)
-       ("ghc-unordered-containers" ,ghc-unordered-containers)))
-    (native-inputs
-     `(("ghc-hspec" ,ghc-hspec)
-       ("ghc-hunit" ,ghc-hunit)
-       ("ghc-monad-control" ,ghc-monad-control)
-       ("ghc-persistent-sqlite" ,ghc-persistent-sqlite)
-       ("ghc-persistent-template" ,ghc-persistent-template)
-       ("ghc-quickcheck" ,ghc-quickcheck)))
-    (home-page "https://github.com/bitemyapp/esqueleto")
-    (synopsis "Type-safe embedded domain specific language for SQL queries")
-    (description "This library provides a type-safe embedded domain specific
+  (let ((version "2.5.3")
+        (revision "1")
+        (commit "b81e0d951e510ebffca03c5a58658ad884cc6fbd"))
+    (package
+      (name "ghc-esqueleto")
+      (version (git-version version revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/bitemyapp/esqueleto")
+               (commit commit)))
+         (sha256
+          (base32
+           "0lz1qxms7cfg5p3j37inlych0r2fwhm8xbarcys3df9m7jy9nixa"))))
+      (build-system haskell-build-system)
+      (arguments
+       `(#:haddock? #f  ; Haddock reports an internal error.
+         #:phases
+         (modify-phases %standard-phases
+           ;; This package normally runs tests for the MySQL, PostgreSQL, and
+           ;; SQLite backends.  Since we only have Haskell packages for
+           ;; SQLite, we remove the other two test suites.  FIXME: Add the
+           ;; other backends and run all three test suites.
+           (add-before 'configure 'remove-non-sqlite-test-suites
+             (lambda _
+               (use-modules (ice-9 rdelim))
+               (with-atomic-file-replacement "esqueleto.cabal"
+                 (lambda (in out)
+                   (let loop ((line (read-line in 'concat)) (deleting? #f))
+                     (cond
+                      ((eof-object? line) #t)
+                      ((string-every char-set:whitespace line)
+                       (unless deleting? (display line out))
+                       (loop (read-line in 'concat) #f))
+                      ((member line '("test-suite mysql\n"
+                                      "test-suite postgresql\n"))
+                       (loop (read-line in 'concat) #t))
+                      (else
+                       (unless deleting? (display line out))
+                       (loop (read-line in 'concat) deleting?)))))))))))
+      (inputs
+       `(("ghc-blaze-html" ,ghc-blaze-html)
+         ("ghc-conduit" ,ghc-conduit)
+         ("ghc-monad-logger" ,ghc-monad-logger)
+         ("ghc-persistent" ,ghc-persistent)
+         ("ghc-resourcet" ,ghc-resourcet)
+         ("ghc-tagged" ,ghc-tagged)
+         ("ghc-text" ,ghc-text)
+         ("ghc-unliftio" ,ghc-unliftio)
+         ("ghc-unordered-containers" ,ghc-unordered-containers)))
+      (native-inputs
+       `(("ghc-hspec" ,ghc-hspec)
+         ("ghc-persistent-sqlite" ,ghc-persistent-sqlite)
+         ("ghc-persistent-template" ,ghc-persistent-template)))
+      (home-page "https://github.com/bitemyapp/esqueleto")
+      (synopsis "Type-safe embedded domain specific language for SQL queries")
+      (description "This library provides a type-safe embedded domain specific
 language (EDSL) for SQL queries that works with SQL backends as provided by
 @code{ghc-persistent}.  Its language closely resembles SQL, so you don't have
 to learn new concepts, just new syntax, and it's fairly easy to predict the
 generated SQL and optimize it for your backend.")
-    (license license:bsd-3)))
+      (license license:bsd-3))))
 
 (define-public shellcheck
   (package
     (name "shellcheck")
-    (version "0.4.6")
+    (version "0.5.0")
     (source
      (origin
        (method url-fetch)
-       (uri (string-append "https://github.com/koalaman/shellcheck/archive/"
-                           "v" version ".tar.gz"))
+       (uri (string-append
+             "https://hackage.haskell.org/package/ShellCheck/ShellCheck-"
+             version ".tar.gz"))
        (sha256
         (base32
-         "1qkd69lc34n3l23ss9rq1azvx49bfq4hi4bmaj76rgxybscxhg0w"))
+         "0z1hscbr11hwkq8k1v0vaa947hb9m6k4cm831jk1gpj8dxrk151b"))
        (file-name (string-append name "-" version ".tar.gz"))))
     (build-system haskell-build-system)
     (inputs
-     `(("ghc-quickcheck" ,ghc-quickcheck)
-       ("ghc-json" ,ghc-json)
+     `(("ghc-aeson" ,ghc-aeson)
+       ("ghc-quickcheck" ,ghc-quickcheck)
        ("ghc-parsec" ,ghc-parsec)
        ("ghc-regex-tdfa" ,ghc-regex-tdfa)))
     (home-page "https://github.com/koalaman/shellcheck")
@@ -9035,6 +9011,11 @@ that are much lighter weight than IO-threads.")
         (base32
          "0y27gafkib0x0fn39qfn2rkgsfrm09ng35sbb5dwr7rclhnxz59l"))))
     (build-system haskell-build-system)
+    (arguments
+     '(#:cabal-revision
+       ("2" "1bx70yqkn62ii17fjv3pig4hklrzkqd09zj67zzjiyjzmn04fir3")
+       ;; Two tests fail: "Discrete CDF is OK" and "Quantile is CDF inverse".
+       #:tests? #f))
     (inputs
      `(("ghc-aeson" ,ghc-aeson)
        ("ghc-base-orphans" ,ghc-base-orphans)
@@ -9054,8 +9035,6 @@ that are much lighter weight than IO-threads.")
        ("ghc-test-framework" ,ghc-test-framework)
        ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
        ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2)))
-    (arguments
-     `(#:tests? #f)) ; FIXME: Test-Suite `spec` fails.
     (home-page "https://github.com/bos/mwc-random")
     (synopsis "Haskell library of statistical types, data, and functions")
     (description "This library provides a number of common functions
@@ -9596,14 +9575,14 @@ as well as a convenient Conduit module.")
 (define-public ghc-aws
   (package
     (name "ghc-aws")
-    (version "0.18")
+    (version "0.20")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://hackage.haskell.org/package/"
                            "aws-" version "/aws-" version ".tar.gz"))
        (sha256 (base32
-                "0h7473wkvc5xjzx5fd5k5fp70rjq5gqmn1cpy95mswvvfsq3irxj"))))
+                "0pwpabmypi1w8rni9qfwabgn95jks4h8dyw6889mn8xzsrhdhyf0"))))
     (build-system haskell-build-system)
     (arguments `(#:tests? #f)) ; Tests require AWS credentials.
     (inputs
@@ -9621,6 +9600,7 @@ as well as a convenient Conduit module.")
        ("ghc-data-default" ,ghc-data-default)
        ("ghc-http-conduit" ,ghc-http-conduit)
        ("ghc-http-types" ,ghc-http-types)
+       ("ghc-lifted-base" ,ghc-lifted-base)
        ("ghc-monad-control" ,ghc-monad-control)
        ("ghc-network" ,ghc-network)
        ("ghc-old-locale" ,ghc-old-locale)
@@ -10608,4 +10588,234 @@ expose it from another module in the hierarchy.
 @end itemize")
     (license license:expat)))
 
+(define-public ghc-cairo
+  (package
+    (name "ghc-cairo")
+    (version "0.13.5.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://hackage.haskell.org/package/cairo/"
+                           "cairo-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1wxylv4d8120ri0vgar168ikqa9m6533ipdwi38qlmxmw20ws2j2"))))
+    (build-system haskell-build-system)
+    (arguments
+     `(#:modules ((guix build haskell-build-system)
+                  (guix build utils)
+                  (ice-9 match)
+                  (srfi srfi-26))
+       #:phases
+       (modify-phases %standard-phases
+         ;; FIXME: This is a copy of the standard configure phase with a tiny
+         ;; difference: this package needs the -package-db flag to be passed
+         ;; to "runhaskell" in addition to the "configure" action, because it
+         ;; depends on gtk2hs-buildtools, which provide setup hooks.  Without
+         ;; this option the Setup.hs file cannot be evaluated.  The
+         ;; haskell-build-system should be changed to pass "-package-db" to
+         ;; "runhaskell" in any case.
+         (replace 'configure
+           (lambda* (#:key outputs inputs tests? (configure-flags '())
+                     #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (input-dirs (match inputs
+                                  (((_ . dir) ...)
+                                   dir)
+                                  (_ '())))
+                    (ghc-path (getenv "GHC_PACKAGE_PATH"))
+                    (params (append `(,(string-append "--prefix=" out))
+                                    `(,(string-append "--libdir=" out "/lib"))
+                                    `(,(string-append "--bindir=" out "/bin"))
+                                    `(,(string-append
+                                        "--docdir=" out
+                                        "/share/doc/" ((@@ (guix build haskell-build-system)
+                                                           package-name-version) out)))
+                                    '("--libsubdir=$compiler/$pkg-$version")
+                                    '("--package-db=../package.conf.d")
+                                    '("--global")
+                                    `(,@(map
+                                         (cut string-append "--extra-include-dirs=" <>)
+                                         (search-path-as-list '("include") input-dirs)))
+                                    `(,@(map
+                                         (cut string-append "--extra-lib-dirs=" <>)
+                                         (search-path-as-list '("lib") input-dirs)))
+                                    (if tests?
+                                        '("--enable-tests")
+                                        '())
+                                    configure-flags)))
+               (unsetenv "GHC_PACKAGE_PATH")
+               (apply invoke "runhaskell" "-package-db=../package.conf.d"
+                      "Setup.hs" "configure" params)
+               (setenv "GHC_PACKAGE_PATH" ghc-path)
+               #t))))))
+    (inputs
+     `(("ghc-utf8-string" ,ghc-utf8-string)
+       ("ghc-text" ,ghc-text)
+       ("cairo" ,cairo)))
+    (native-inputs
+     `(("ghc-gtk2hs-buildtools" ,ghc-gtk2hs-buildtools)
+       ("pkg-config" ,pkg-config)))
+    (home-page "http://projects.haskell.org/gtk2hs/")
+    (synopsis "Haskell bindings to the Cairo vector graphics library")
+    (description
+     "Cairo is a library to render high quality vector graphics.  There exist
+various backends that allows rendering to Gtk windows, PDF, PS, PNG and SVG
+documents, amongst others.")
+    (license license:bsd-3)))
+
+(define-public ghc-chart-cairo
+  (package
+    (name "ghc-chart-cairo")
+    (version "1.9")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://hackage.haskell.org/package/Chart-cairo/"
+                           "Chart-cairo-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0iany6lfyfb1cw0pxfs5aw5k0a6x41m6ql9ad9w59biwdckbsyqr"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-old-locale" ,ghc-old-locale)
+       ("ghc-cairo" ,ghc-cairo)
+       ("ghc-colour" ,ghc-colour)
+       ("ghc-data-default-class" ,ghc-data-default-class)
+       ("ghc-operational" ,ghc-operational)
+       ("ghc-lens" ,ghc-lens)
+       ("ghc-chart" ,ghc-chart)))
+    (home-page "https://github.com/timbod7/haskell-chart/wiki")
+    (synopsis "Cairo backend for Charts")
+    (description "This package provides a Cairo vector graphics rendering
+backend for the Charts library.")
+    (license license:bsd-3)))
+
+(define-public ghc-atomic-write
+  (package
+    (name "ghc-atomic-write")
+    (version "0.2.0.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/atomic-write/atomic-write-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "1iaq0hprxcv0sl1sgwcgmm87zraf738va1bciwnx2jkk3k1v9iyv"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-temporary" ,ghc-temporary)
+       ("ghc-unix-compat" ,ghc-unix-compat)
+       ("ghc-text" ,ghc-text)))
+    (native-inputs
+     `(("ghc-temporary" ,ghc-temporary)
+       ("ghc-unix-compat" ,ghc-unix-compat)
+       ("ghc-text" ,ghc-text)
+       ("ghc-hspec" ,ghc-hspec)
+       ("hspec-discover" ,hspec-discover)))
+    (home-page "https://github.com/stackbuilders/atomic-write")
+    (synopsis "Atomically write to a file")
+    (description
+     "Atomically write to a file on POSIX-compliant systems while preserving
+permissions.  @code{mv} is an atomic operation.  This makes it simple to write
+to a file atomically just by using the @code{mv} operation.  However, this
+will destroy the permissions on the original file.  This library preserves
+permissions while atomically writing to a file.")
+    (license license:expat)))
+
+(define-public ghc-cereal-conduit
+  (package
+    (name "ghc-cereal-conduit")
+    (version "0.8.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://hackage.haskell.org/package/"
+                           "cereal-conduit/cereal-conduit-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "1srr7agvgfw78q5s1npjq5sgynvhjgllpihiv37ylkwqm4c4ap6r"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-conduit" ,ghc-conduit)
+       ("ghc-resourcet" ,ghc-resourcet)
+       ("ghc-cereal" ,ghc-cereal)))
+    (native-inputs
+     `(("ghc-hunit" ,ghc-hunit)))
+    (home-page "https://github.com/snoyberg/conduit")
+    (synopsis "Turn Data.Serialize Gets and Puts into Sources, Sinks, and Conduits")
+    (description
+     "This package turn @code{Data.Serialize} @code{Gets} and @code{Puts} into
+@code{Sources}, @code{Sinks}, and @code{Conduits}.")
+    (license license:bsd-3)))
+
+(define-public ghc-weigh
+  (package
+    (name "ghc-weigh")
+    (version "0.0.12")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://hackage.haskell.org/package/weigh/"
+                           "weigh-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0zw2a997gxgdzqmd7j730kxgynzmjvvlkw84dajmfzf1v9pbij7x"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-split" ,ghc-split)
+       ("ghc-temporary" ,ghc-temporary)))
+    (home-page "https://github.com/fpco/weigh#readme")
+    (synopsis "Measure allocations of a Haskell functions/values")
+    (description "This package provides tools to measure the memory usage of a
+Haskell value or function.")
+    (license license:bsd-3)))
+
+(define-public ghc-linear
+  (package
+    (name "ghc-linear")
+    (version "1.20.8")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://hackage.haskell.org/package/linear/"
+                           "linear-" version ".tar.gz"))
+       (sha256
+        (base32
+         "046vkvxlb0s286qr55s0c6db0rlwbm1cmlmwhrrkqbkzhfcipgay"))))
+    (build-system haskell-build-system)
+    (inputs
+     `(("ghc-adjunctions" ,ghc-adjunctions)
+       ("ghc-base-orphans" ,ghc-base-orphans)
+       ("ghc-bytes" ,ghc-bytes)
+       ("ghc-cereal" ,ghc-cereal)
+       ("ghc-distributive" ,ghc-distributive)
+       ("ghc-hashable" ,ghc-hashable)
+       ("ghc-lens" ,ghc-lens)
+       ("ghc-reflection" ,ghc-reflection)
+       ("ghc-semigroups" ,ghc-semigroups)
+       ("ghc-semigroupoids" ,ghc-semigroupoids)
+       ("ghc-tagged" ,ghc-tagged)
+       ("ghc-transformers-compat" ,ghc-transformers-compat)
+       ("ghc-unordered-containers" ,ghc-unordered-containers)
+       ("ghc-vector" ,ghc-vector)
+       ("ghc-void" ,ghc-void)))
+    (native-inputs
+     `(("cabal-doctest" ,cabal-doctest)
+       ("ghc-doctest" ,ghc-doctest)
+       ("ghc-simple-reflect" ,ghc-simple-reflect)
+       ("ghc-test-framework" ,ghc-test-framework)
+       ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)
+       ("ghc-hunit" ,ghc-hunit)))
+    (home-page "http://github.com/ekmett/linear/")
+    (synopsis "Linear algebra library for Haskell")
+    (description
+     "This package provides types and combinators for linear algebra on free
+vector spaces.")
+    (license license:bsd-3)))
+
 ;;; haskell.scm ends here