def write_partition_str(partitions) -> str:
    """
    Return the string representation of the partition function.
    """
    output = "let partition node = match node with\n"
    for i, nodes in enumerate(partitions):
        output += "\n".join([f"  | {node}n -> {i}" for node in nodes]) + "\n"
    return output