From the viewpoint of categorial logic, how should the notion of a topological $R$-module be defined? Edit. What I really want is to view a topological $R$-module as being a model of some theory $T$ (dependent on the topological ring $R$) in $\mathrm{Top}.$ Can this be done?

Original question. From the viewpoint of categorial logic, how should the notion of a topological $R$-module be defined?
As far as I can see, there's basically two approaches, both of which are defective.
There's the two-sorted approach. You have theory of modules with two sorts, one denoted $R$ for the ring of scalars, and the other denoted $V$ for the abelian group of vectors. This works great, because the models of our theory in $\mathrm{Top}$ are precisely the topological modules that we know and love. However, there's a problem: we end up with one big category of topological modules, rather than a different category of topological $R$-modules for every topological ring $R.$ Furthermore the homomorphisms between modules aren't the usual $R$-module homomorphisms, for obvious reasons.
Alternatively, there's the single-sorted approach. Rather than having a sort for the scalars, simply fix a ring $R$, and for every $r \in R$ have a function symbol $r' : V \rightarrow V$ representing scalar multiplication by $r$. However, now the models of our theory in $\mathrm{Top}$ aren't always topological $R$-modules, because any topological structure that $R$ might have is simply being ignored.
So, how should topological $R$-modules be defined? To reiterate, I'd like to be able to view a topological $R$-module as simply a model of some theory $T$ (dependent on $R$) in $\mathrm{Top}.$ Can this be done?
 A: Let $C$ be a category with products. Note that we have the notions of ring objects and abelian group objects internal to $C$. These can be easily fused to the notion of a module object: If $R$ is a ring object and $M$ is an abelian group object, then an action of $R$ on $M$ is a morphism $R \times M \to M$ which makes the four obvious diagrams commute (which correspond to $1m=m$, $(rs)m=r(sm)$, $r(m+n)=rm+rn$, $(r+s)m=rm+sm$). Then we call $M$ an $R$-module. For $C=\mathsf{Set}$ this is the usual notion, for $C=\mathsf{Top}$ we get topological $R$-modules for a topological ring $R$.
A: One straightforward notion of enriched algebraic theory is that of an operad. Fix a monoidal category $\mathcal{V}$. A (non-symmetric, monochromatic) $\mathcal{V}$-operad $\mathbb{T}$ consists of the following data:


*

*For each natural number $n$, an object $\mathbb{T}(n)$ in $\mathcal{V}$, which we think of as being the space of $n$-ary operations of $\mathbb{T}$.

*For each partition $n = m_0 + \cdots + m_{k-1}$, a morphism
$$\mathbb{T} (k) \otimes \mathbb{T} (m_0) \otimes \cdots \otimes \mathbb{T} (m_{k-1}) \to \mathbb{T} (n)$$
satisfying a generalised associativity law, which we think of as computing the result of composing a $k$-ary operation with a $k$-tuple of other operations.


A (left) $\mathbb{T}$-algebra in $\mathcal{V}$ is an object $A$ equipped with the following data:


*

*For each natural number $n$, a morphism $\mathbb{T} (n) \otimes A^{\otimes n} \to A$, which we think of as computing the result of applying an $n$-ary operation to an $n$-tuple of elements of $A$.


For example, given a monoid $T$ in $\mathcal{V}$, we can define a $\mathcal{V}$-operad $\mathbb{T}$ as follows: 


*

*$\mathbb{T} (0) = I$, the unit of the monoidal category $\mathcal{V}$.

*$\mathbb{T} (1) = T$.

*The composition $\mathbb{T} (1) \otimes \mathbb{T} (1) \to \mathbb{T} (1)$ is the monoid operation of $T$, and all other compositions are forced by the axioms.


Then a $\mathbb{T}$-algebra is precisely a $T$-module in the usual sense. To apply this to topological modules over a topological ring, one wants to take $\mathcal{V}$ to be a category of topological abelian groups with a suitable topological tensor product, but I am unfamiliar with the details.
