def join(*functions, extension=None):
    """
    Returns a function that joins the given functions' outputs.

    >>> join(components(-1), parameters('page'))('http://example.com/api/planning.json?page=1')
    'planning-page-1'
    """
    def wrapper(url):
        value = '-'.join(function(url) for function in functions)
        if extension:
            return f'{value}.{extension}'
        return value
    return wrapper