View source

class thx.Functions2

import thx.Functions;

Available on all platforms

Helper class for functions that take 2 arguments

Class Fields

static function curry<A, B, C>(f:A -> B -> C):A -> B -> C

static function fn<T, T2, T3>(fn:T -> T2 -> T3, restArgs:Dynamic):Dynamic

Lambda expressions

static function memoize<T1, T2, TOut>(callback:T1 -> T2 -> TOut, ?resolver:T1 -> T2 -> String):T1 -> T2 -> TOut

memoize wraps callback and calls it only once storing the result for future needs.

Computed results are stored in an internal map. The keys to this map are generated by the resolver function that by default directly converts the arguments into a string.

static inline function negate<T1, T2>(callback:T1 -> T2 -> Bool):T1 -> T2 -> Bool

Wraps callback in a function that negates its results.

Toggle inherited fields