func As(constructor interface{}, as interface{}) interface{} {
	if op, ok := constructor.(OptionalProvider); ok {
		op.Options = append(op.Options, dig.As(as))
		return op
	}
	return OptionalProvider{
		Constructor: constructor,
		Options:     []dig.ProvideOption{dig.As(as)},
	}
}
As constructs the instance and bind it to another interface. As means to be used as an argument to graph.Provide.
For example:
As(MyConstructor, new(MyAbstractInterface))
package di
import (
	"reflect"
	"go.uber.org/dig"
)
type OptionalProvider struct {
	Constructor interface{}
	Options     []dig.ProvideOption
}
func LocationForPC(constructor interface{}, pc uintptr) interface{} {
	if op, ok := constructor.(OptionalProvider); ok {
		op.Options = append(op.Options, dig.LocationForPC(pc))
		return op
	}
	return OptionalProvider{
		Constructor: constructor,
		Options:     []dig.ProvideOption{dig.LocationForPC(pc)},
	}
}