function genSettler (self, state) {
      var isCalled = false;
      return function (value) {
          if (isCalled) return;
          isCalled = true;

          if (isLongStackTrace)
              self[$settlerTrace] = genTraceInfo(true);

          if (state === $resolved)
              settleWithX(self, value);
          else
              settlePromise(self, state, value);
      };
  }
It will produce a settlePromise function to user.
Such as the resolve and reject in this `new Yaku (resolve, reject) ->`.
@private
@param  {Yaku} self
@param  {Integer} state The value is one of `$pending`, `$resolved` or `$rejected`.
@return {Function} `(value) -> undefined` A resolve or reject function.