purify = (fn) => {
  return ({valueOf: fn}).valueOf();
}
Tricks Closure Compiler into believing that a function is pure.  The compiler
assumes that any `valueOf` function is pure, without analyzing its contents.

@param {function(): T} fn
@return {T}
@template T