Pattern-like names are very much an OOP convention. In FP, higher-order functions aren't a pattern, they're just syntax. You typically use names that go with the domain.
Functions that return a function aren't usually thought of as creating a function, but as supplying parts of the arguments to a function at different times. In languages that support a curried function argument syntax, you almost always use that instead of the way you wrote it. This is usually to meet the signature requirements of some callback function.
For example:
const logEvent = (string) => () => console.log(string);
document.getElementById("myButton").onclick = logEvent("myButton clicked!");
document.getElementById("another").onclick = logEvent("another clicked!");
Here, onclick
requires a function, but I don't want to repeat the clutter of anonymous functions all over the place, so I create a curried function. The logEvent
name describes the function that eventually happens when the onclick
event occurs. Note if I had named this something like createStringClickHandler
, it would be a lot more difficult to determine at the calling point what it's actually doing.
makeFoo
function in an arbitrary situation depends entirely on what the purpose of the function is in that specific situation; there is no generic, correct answer to your question.