To declare function you should use fun keyword:

fun foo() {}

You can place private before fun keyword to make function private so you can't use that function from other module.

Function type

If you need to declare function type you need use this syntax:

(param_type,*) -> (return_type)


var x: (int,int) -> int = add;