decorates a function in a domain