static public function sayHello() : String { return "hi!"; }
has type: Void -> String
The last element is the type the function returns; previous elements are the types of the arguments.
static public function factory(generator : String -> String -> String, times : Int) : Int -> String;
Consider this function which takes as arguments one function (with 2 arguments and that returns a string) and an integer value and returns a function.
Its type is: (String -> String -> String) -> Int -> (Int -> String)
If you are in doubt what the correct type is, you can always use the type
command. It is only used at compile time and returns in the console the type of its argument:
type(factory);
Should print what I wrote above.