-- ---------------------------------------------------------------------

{-

typedef struct bucket_struct
{
  int count;
  hn_t *hns;
} *bucket_t;

bucket_t bucket_new();
void bucket_free(bucket_t b);

void bucket_add(bucket_t b, hn_t h);
hn_t bucket_in(bucket_t b, hn_t h);
-}

-- ---------------------------------------------------------------------
{-
// simple array index function
hn_t bucket_get(bucket_t b, int index);
-}

-- |simple array index function
bucket_get :: Bucket -> Int -> Maybe HashName
bucket_get b index =
  if index > Set.size b || Set.size b == 0
    then Nothing
    else Just $ ghead "bucket_get" $ drop index $ Set.toList b
bucket_get :: Bucket -> Int -> Maybe HashName
bucket_get b index =
  if index > Set.size b || Set.size b == 0
    then Nothing
    else Just $ ghead "bucket_get" $ drop index $ Set.toList b
bucket_get b index =
  if index > Set.size b || Set.size b == 0
    then Nothing
    else Just $ ghead "bucket_get" $ drop index $ Set.toList b