def _w(file_):
    """Returns a function which writes data to the given file.

    Args:
        file_ (File): A file.

    Returns:
        function: A function with the signature "f(string)" that writes the
            input string terminated with a newline character to file_.
    """
    return lambda data: file_.write(data + '\n')