haxe

How do you specify a function type with multiple arguments in Haxe?


I'm trying to specify a function type to a function receiving two or more parameters. For a function with one parameter it's easy:

var myFunction : Int -> Void;

You can reference a function like this with it:

function doSomething ( param1 : Int ) : Void { ... }
...
myFunction = doSomething;

But how do you reference a function with two or more parameters? Unfortunately there is still no complete documentation about this.

Thanks in advance!


Solution

  • My Haxe is a bit rusty, but...

    var myFunction : Int -> Int -> Void;
    

    A function that takes two Int args and returns Void.