Proposal: Command Syntax

I would like some clarification on this point:

So, is a function like this a command or a query?

function getUserInfo(userId) {
  return fetch(`https://${HOST}/users/${encodeURIComponent(userId)}`)
    .then(res => res.json());
}

It's not changing the state of the system, rather, it's just querying an external resource. But, it does perform a side-effect (it sends out an HTTP request) in order to perform that query, and so it is not a pure function.

Reading various online resources, it feels like a function like this is supposed to be interpreted as a query (not a command), but those same online resources like to use the terminology "no side-effects" or "impure" to describe queries, which if we took those statements literally, it would mean that the above should be interpreted as a command. I suspect they were just using the terms "side-effect" and "pure" more loosely than how it's traditionally defined. But, I want to check to see how you're defining a command and query, and if you really mean command==impure and query==pure.

If so, there is at least one other thread I know of, that discussed differentiating between pure and impure functions, along with some runtime enforcement of it, that may be applicable to this discussion: Add pure function modifier, build Hoogle equivalent