def context_value(name):
    """
    Returns an effect that drops the current value, and replaces it with
    the value from the context with the given name.
    """

    def context_value(_value, context, **_params):
        return defer.succeed(context[name])

    return context_value