In most probability theory texts you'll see a random variable definition that goes something like this:
A probability space is a triple $(\Omega, \mathcal{F}, P)$, a real valued random variable is a function $X:\Omega \rightarrow \mathbb{R}$
The computer scientist in my head can't get around what seems to be a type-error. Is a random variable dependent on $P$ or not. My intuition says it is, which is why we say things like 'uniformly distributed random variable', but in this case shouldn't a random variable be a function from the probability space, i.e. $X:(\Omega, \mathcal{F}, P) \rightarrow \mathbb{R}$. In fact this is how it is defined in Wolframs mathworld.
Alternatively, one could imagine in a functional programming language a function which counts the number of heads from a set of coin tosses. This function could be independent of whether or not the coin is fair or biased, etc, and hence in some way independent of $P$.
I understand some of this may be just for convenience when speaking, but this is how a random variable is rigorously defined, so I believe I must be missing something. In other words, my question is, is a random variable associated with probabilities or independent of it.