provide a Show instance that works for all WorkerPools
authorJoey Hess <joeyh@joeyh.name>
Thu, 14 Nov 2019 15:00:59 +0000 (11:00 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 14 Nov 2019 15:00:59 +0000 (11:00 -0400)
Types/WorkerPool.hs

index 23ef345574a3768d00a880d14a60887d85e1dcd5..178c30166c574bf5b87d780b6d918029a1938a8d 100644 (file)
@@ -20,7 +20,14 @@ data WorkerPool t = WorkerPool
        -- but there can temporarily be fewer values, when a thread is
        -- changing between stages.
        } 
-       deriving (Show)
+
+instance Show (WorkerPool t) where
+       show p = unwords
+               [ "WorkerPool"
+               , show (usedStages p)
+               , show (workerList p)
+               , show (length (spareVals p))
+               ]
 
 -- | A worker can either be idle or running an Async action.
 -- And it is used for some stage.