Don't cache keyFn fn for Hash, cache valueFn when types match