Returns decorator that calls wrapped function
    if nothing was found in cache for its argument.

    Wrapped function arguments should be hashable.

def map_(cache: Mapping[Domain, Range]) -> Operator[Map[Domain, Range]]:
    """
    Returns decorator that calls wrapped function
    if nothing was found in cache for its argument.

    Wrapped function arguments should be hashable.
    """

    def wrapper(function: Map[Domain, Range]) -> Map[Domain, Range]:
        @wraps(function)
        def wrapped(argument: Domain) -> Range:
            try:
                return cache[argument]
            except KeyError:
                return function(argument)

        return wrapped

    return wrapper