def hkl_type(h, k, l):
    """
    Returns the general hkl type (e.g. 'hh0') for a given set of miller
    indices. Valid for all Bravais lattices.
    """
    zero_count = sum(1 if i == 0 else 0 for i in [h, k, l])
    diff_count = len(set([h, k, l]))

    if diff_count == 3:
        if zero_count == 0:
            return 'hkl'
        else:
            return 'hk0' if not l else 'h0l' if not k else '0kl'
    elif diff_count == 2:
        if zero_count == 0:
            return 'hhl'
        elif zero_count == 1:
            return 'hh0' if h == k else '0kk'
        else:
            return 'h00' if h else '0k0' if k else '00l'
    else:
        return 'hhh'