def function_def(printer, ast):
    """Prints "type func_name(....) { ... }"."""
    type_str = printer.ast_to_string(ast["type"])
    name_str = ast["name"]
    params_str = ', '.join(map(lambda param: printer.ast_to_string(param), ast["params"]))
    body_str = printer.ast_to_string(ast["body"])
    return f'\n{type_str} {name_str}({params_str}) {body_str}'