(Bucket weaks) =
  mapMaybeM deRefWeak weaks

bucketFromList :: [Weak a] -> Maybe (Bucket a)
bucketFromList = \case
  [] -> Nothing
  weaks -> Just (Bucket weaks)
bucketFromList = \case
  [] -> Nothing
  weaks -> Just (Bucket weaks)