type: support implicit "identity" transformation
Almost every implementation of title_patterns on a type returned with a
lambda that performed an "identity" transformation - lambda {|x| x }.
That actually cost a notable amount of memory allocation, because it created a
new instance of the lambda on every invocation. That represented about three
percent of total memory allocation, or 8MB total.
This allows the title_patterns data to simply omit the lambda - if you don't
supply one, we don't invoke it to transform the result, just assign directly.
This allows everyone to keep using this the way they currently do, including
supplying an identity lambda if they want, but allows internal types and types
that don't override the default to be more memory efficient.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>