Subject: [PATCH 1/3] gnu: Add ghc-atomic-primops.

From: "Alex Griffin" <[email-masked]>
Date: Sat, 12 Oct 2019 19:33:58 +0000

-- 
Alex Griffin

From 77ff329dd34d307f19629086baf44c1623858fa1 Mon Sep 17 00:00:00 2001
From: Alex Griffin <[email-masked]>
Date: Sat, 12 Oct 2019 13:34:43 -0500
Subject: [PATCH 1/3] gnu: Add ghc-atomic-primops.

* gnu/packages/haskell-xyz.scm (ghc-atomic-primops): New variable.
---
 gnu/packages/haskell-xyz.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index 2977398880..37df2ed909 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -21,6 +21,7 @@
 ;;; Copyright © 2019 Jacob MacDonald <[email-masked]>
 ;;; Copyright © 2019 John Soo <[email-masked]>
 ;;; Copyright © 2019 Kyle Meyer <[email-masked]>
+;;; Copyright © 2019 Alex Griffin <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -381,6 +382,31 @@ over threads in Haskell, in which @code{Async a} is a concurrent thread that
 will eventually deliver a value of type @code{a}.")
     (license license:bsd-3)))
 
+(define-public ghc-atomic-primops
+  (package
+    (name "ghc-atomic-primops")
+    (version "0.8.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/atomic-primops/atomic-primops-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "03n5dmyplrqgbyf8dr91izkxci7gkl3i3fnp82i5ld869zrgjfh0"))))
+    (build-system haskell-build-system)
+    (inputs `(("ghc-primitive" ,ghc-primitive)))
+    (home-page "https://github.com/rrnewton/haskell-lockfree/wiki")
+    (synopsis "Safe approach to CAS and other atomic ops")
+    (description
+     "After GHC 7.4 a new @code{casMutVar#} primop became available, but it's
+difficult to use safely, because pointer equality is a highly unstable property
+in Haskell.  This library provides a safer method based on the concept of
+@code{Ticket}s.")
+    (license license:bsd-3)))
+
 (define-public ghc-atomic-write
   (package
     (name "ghc-atomic-write")
-- 
2.23.0