e) bucketToList (IntMap.toList board)
  Text.putStrLn (Text.unlines ("PinBoard" : map row contents))
  where
    row (n, xs) =
      Text.pack (show n) <> " => " <> Text.pack (show (map f xs))

debugSize :: PinBoard a -> IO Int
debugSize (PinBoard boardVar) = do
  board <- readMVar boardVar
  foldlM step 0 board
  where
    step :: Int -> Bucket a -> IO In
debugDump :: MonadIO m => (a -> Text) -> PinBoard a -> m ()
debugDump f (PinBoard boardVar) = liftIO do
  board <- readMVar boardVar
  contents <- (traverse . traverse) bucketToList (IntMap.toList board)
  Text.putStrLn (Text.unlines ("PinBoard" : map row contents))
  where
    row (n, xs) =
      Text.pack (show n) <> " => " <> Text.pack (show (map f xs))
debugDump f (PinBoard boardVar) = liftIO do
  board <- readMVar boardVar
  contents <- (traverse . traverse) bucketToList (IntMap.toList board)
  Text.putStrLn (Text.unlines ("PinBoard" : map row contents))
  where
    row (n, xs) =
      Text.pack (show n) <> " => " <> Text.pack (show (map f xs))