code: public static <T, R> Function1<T, R> memoizeFunction(final Function<T, R> fn, final Cacheable<R> cache) {
          LazyImmutable<R> nullR = LazyImmutable.def();
          return t -> t==null? nullR.computeIfAbsent(()->fn.apply(null)) : (R)cache.soften()
                           .computeIfAbsent(t, (Function) fn);
      }
docs: Convert a Function into one that caches it's result
  
  @param fn Function to memoise
  @param cache Cachable to store the results
  @return Memoised Function