To declare function you should use fun keyword:
fun
fun foo() {}
You can place private before fun keyword to make function private so you can't use that function from other module.
private
If you need to declare function type you need use this syntax:
(param_type,*) -> (return_type)
Example:
var x: (int,int) -> int = add;
Last updated 6 years ago