Comment

Comment by trealira

> Isn't Int -> String -> String a shorthand for Int -> (String -> String)?

Yes. Though I find it more convenient think of it as a function with multiple arguments and not a function that returns another function.

> Thus I would have assumed the first argument to the result of sprintf "%s %d" would be an integer, then a string and the final result would be a string.

Why assume that? (Not rhetorical.) Wouldn't that be like if in C, you had to write the arguments in reverse order of the format string, like this?

  printf("%s %d!\n", 5, "hi");
parent trealira 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton