def mk_parser(header, null_values=('',)):
    """
    Return a function that will parse a record according to the given
    header.

    header: Sequence<(str, function<T>(str)->T)>
        Indexable collection of (name, func) pairs where the function
        parses a string into a value of the desired type.
    null_values: Collection<str>
        Set of unparsed values to replace with `None` instead of
        parsing.
    """
    hdr_len = len(header)
    def parse_record(record):
        return [(parse(text) if text not in null_values else None)
                for ((_, parse), text) in zip(header, record)]
    return parse_record