Turns this partial function into a plain function returning an Option result.

@return a function that takes an argument x to Some(this.apply(x)) if this can be applied, and to None otherwise.
5043
public F0<Option<R>> lift() {
            final F0<R> me = this;
            return new F0<Option<R>>() {
                @Override
                public Option<R> apply() {
                    try {
                        return some(me.apply());
                    } catch (RuntimeException e) {
                        return none();
                    }
                }
            };
        }
1218088
function (tpl, option) {
            var code = compiler.compile(tpl);
            option = option || {};
            // eval is not ok for eval("(function(){})") ie
            return (Function.apply(null, []
                .concat(code.params)
                .concat(code.source.join('\n') + '//@ sourceURL=' +
                    (option.name ? option.name : ('xtemplate' + (xtemplateId++))) + '.js')));
        }
1296512
@Nonnull
	public <V1 extends T1, V2 extends T2> LToFltBiFunctionBuilder<T1, T2> aCase(Class<V1> argC1, Class<V2> argC2, LToFltBiFunction<V1, V2> function) {
		PartialCaseWithFltProduct.The pc = partialCaseFactoryMethod((a1, a2) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstance(a2)));

		pc.evaluate(function);
		return self();
	}
59182
static Function<Optional<Descriptor>, String> concat(
      final Function<? super Optional<Descriptor>, String> function1,
      final Function<? super Optional<Descriptor>, String> function2) {
    return new Function<Optional<Descriptor>, String>() {
      @Override
      public String apply(Optional<Descriptor> optDescriptor) {
        return function1.apply(optDescriptor) + function2.apply(optDescriptor);
      }
    };
  }
1013311
function(foo, self) {
        return function() {
            var arg, tmp, args = [];
            for (var i = 0, l = arguments.length; i < l; i++) {
                arg = arguments[i];
                if (_isFunction(arg)) {
                    if (arg.tryWrap) {
                        arg = arg.tryWrap;
                    } else {
                        tmp = cat(arg);
                        arg.tryWrap = tmp;
                        arg = tmp;
                    }
                }
                args.push(arg);
            }
            return foo.apply(self || this, args);
        };
    }
412576
function(callback) {
                var ret,
                    isFunc  = Util.type.function(callback),
                    args    = [].slice.call(arguments, 1);
               
                if (isFunc)
                    ret     = callback.apply(null, args);
                
                return ret;
            }
1069898
function partial(...args) {
  const fn = args[0]
  const xs = args.slice(1)

  if(!isFunction(fn)) {
    throw new TypeError('partial: Function required for first argument')
  }

  return curry(
    Function.bind.apply(fn, [ null ].concat(xs))
  )
}
1091801
public final Optional<L> asOptionalLeft() {
		return fold(Optional::of, val -> Optional.<L> empty());
	}
287027
function methodWrapper(fn) {
  return function() {
    var args = [].slice.call(arguments);
    args.unshift(this);
    return fn.apply(this, args);
  };
}
270746
public static <T> OptionType<T> of(
    final @Nullable T x)
  {
    if (x == null) {
      return None.none();
    }

    return Some.some(x);
  }
467387
function partialAny(fn /* arguments */) {
    var appliedArgs = Array.prototype.slice.call(arguments, 1);
    if ( appliedArgs.length < 1 ) return fn;

    return function () {
      var args = _.deepClone(appliedArgs);
      var partialArgs = _.toArray(arguments);
      for (var i=0; i < args.length; i++) {
        if ( args[i] === _ )
          args[i] = partialArgs.shift();
      }
      return fn.apply(this, args.concat(partialArgs));
    };
  }
492320
public static <B> Function<Example<?, B>, B> outputGetter() {
    return new Function<Example<?, B>, B>() {
      @Override
      public B apply(Example<?, B> item) {
        return item.getOutput();
      }
    };
  }
544063
function partial (fn) {
    var args = Array.prototype.slice.call(arguments, 1)
    return function () {
      var arg = 0
      for (var i = 0; i < args.length && arg < arguments.length; i++) {
        if (args[i] === undefined) args[i] = arguments[arg++]
      }
      return fn.apply(this, args)
    }
  }
28143
public static function partial()
    {
        $args = func_get_args();
        $f = array_shift($args);
        return function () use ($f, $args) {
            return call_user_func_array($f, array_merge($args, func_get_args()));
        };
    }
1122323
public F1<P1, Option<R>> lift() {
            final F1<P1, R> me = this;
            return new F1<P1, Option<R>>() {
                @Override
                public Option<R> apply(P1 p1) {
                    try {
                        return some(me.apply(p1));
                    } catch (RuntimeException e) {
                        return none();
                    }
                }
            };
        }
276754
public <T> T get(@NonNull String optionName) {
      optionName = optionName.replaceAll("^-+", "");
      NamedOption option = options.get(optionName);

      if (option == null) {
         return Cast.as(unamedOptions.get(optionName));
      }

      if (option.isBoolean()) {
         return option.getValue() == null ? Cast.as(Boolean.FALSE) : option.getValue();
      }

      return option.getValue();
   }
66629
@SuppressWarnings("unchecked")
    public static <T> Function<T, T> compose(final Function<T, T> ... func) {
        return new Function<T, T>() {
            public T apply(final T arg) {
                T result = arg;
                for (int index = func.length - 1; index >= 0; index -= 1) {
                    result = func[index].apply(result);
                }
                return result;
            }
        };
    }