From 9a77766ee64a4c86a0d7678166b45eb96567d778 Mon Sep 17 00:00:00 2001 From: Javier Sagredo Date: Fri, 22 Nov 2024 14:06:19 +0100 Subject: [PATCH] Added `Generic` and `NoThunks` instances for `RAWState` --- rawlock/CHANGELOG.md | 4 ++++ rawlock/src/Control/RAWLock.hs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rawlock/CHANGELOG.md b/rawlock/CHANGELOG.md index 2499a8f..80066ec 100644 --- a/rawlock/CHANGELOG.md +++ b/rawlock/CHANGELOG.md @@ -2,6 +2,10 @@ # Changelog entries +## 0.1.1.0 -- 2024-11-22 + +* Added `Generic` and `NoThunks` instance for `RAWState`. + ## 0.1.0.0 -- 2024-10-22 * First version. Released on an unsuspecting world. diff --git a/rawlock/src/Control/RAWLock.hs b/rawlock/src/Control/RAWLock.hs index bed9fe5..c885f01 100644 --- a/rawlock/src/Control/RAWLock.hs +++ b/rawlock/src/Control/RAWLock.hs @@ -155,7 +155,7 @@ data RAWState = RAWState { waitingReaders :: !Readers , waitingAppenders :: !Appenders , waitingWriters :: !Writers - } deriving Show + } deriving (Show, Generic, NoThunks) noWriters :: Poisonable RAWState -> Bool noWriters (Healthy (RAWState _ _ w)) = w == 0