from typing import Iterable


def stringify(symbols='•꞉⋮'):
    """
    Construct a function to convert a set (of sets [of sets {...}]) into a string.

    Parameters
    ----------
    symbols : str
        The symbols to utilize to separate elements.

    Returns
    -------
    strinifier : func
        A function which stringifies.
    """
    def stringifier(things):
        """
        Convert a set (of sets [of sets {...}]) into a string.

        Parameters
        ----------
        things : (frozen)set
            The set (of sets [of sets {...}]) to stringify.

        Returns
        -------
        string : str
            The string representation of `things`.
        """
        try:
            things = list(things)
        except TypeError:  # pragma: no cover
            return str(things)

        try:
            if isinstance(things[0], Iterable) and not isinstance(things[0], str):
                stringer = stringify(symbols[1:])
                string = symbols[0].join(sorted((stringer(thing) for thing in things), key=lambda t: (-len(t), t)))
            else:
                raise IndexError
        except IndexError:
            string = ''.join(map(str, sorted(things)))

        return string if string else '∅'

    return stringifier