What is a variable?
I know that a ($n$-ary) connective can be thought of as a function from $\{ 0,1 \}^n$ to $\{ 0,1 \}$.
And a quantifier over $M$ can be thought of as a set of subsets of $M$.
What is the corresponding way to think of a variable ranging over $M$ ?
You can see Categorial grammar and, in detail : Sara Negri & Jan von Plato, Structural Proof Theory (2001), Appendix A.2 : CATEGORIAL GRAMMAR FOR LOGICAL LANGUAGES [page 221].
And so on ...