Skip to content

Instantly share code, notes, and snippets.

@SimonRichardson
Created March 6, 2013 11:27
Show Gist options
  • Save SimonRichardson/5098692 to your computer and use it in GitHub Desktop.
Save SimonRichardson/5098692 to your computer and use it in GitHub Desktop.
package ;
typedef Function2Type<T1, T2, R> = T1 -> T2 -> R;
abstract Function2<T1, T2, R>(Function2Type<T1, T2, R>) from Function2Type<T1, T2, R> to Function2Type<T1, T2, R> {
inline function new(func : Function2Type<T1, T2, R>) {
this = func;
}
}
class Main {
public static function main() : Void {
var func : Function2<Int, Int, Int> = function(a, b) return a + b;
trace(func(1, 2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment