News for hackers. Stuff that matters.
Re:Dave Herman’s contributions to Rust by willtim on Monday May 03, 2021 @11:57AM (#27026705)
> Imagine the function "fn bar(x: fn(x: int) -> string)", would that be more clear with a colon?

In your example, why bother naming the inner "x" variable for the function param? It cannot be used on the right-hand-side (definition of "bar"). For that reason, the notation is not exactly "clear". In OCaml the annotation would be:

bar( x : int -> string )

Re:Dave Herman’s contributions to Rust by east2west on Monday May 03, 2021 @01:11PM (#27027754)
In Rust you can write ```f: fn(i32) -> i32```.

Ocaml's syntax is more consistent, I agree, but its colon operator has different precedence than in Rust, so I am not sure its rational applies to Rust.