Generalization of metric spaces? Usually we define a metric on a space $X$ to be a map $X\times X\to\mathbb{R}$ that satisfies a few axioms. $\mathbb{R}$ has of course a total order. What if we instead have a metric $X\times X\to A$ where $A$ is a monoid with some kind of weaker order on it (I say monoid because the triangle inequality requires addition, and we'd also need a zero). It seems to me that if $A$ is a monoid and directed set, and if we define open sets as sets for which every point has a ball around it contained in the set, then this generalized metric induces a topology on $X$.
Is this a thing already? Which topological spaces can be endowed with this kind of metric? This feels natural because when going from metric spaces to topological spaces we have to talk about nets (maps from directed sets) rather than sequences (maps from the natural numbers). This is in a way analogous.
Edit: Changed group to monoid.
 A: The paper 
Ralph Kopperman. 1988. All topologies come from generalized metrics. Am. Math. Monthly 95, 2 (February 1988), 89-97, doi:10.2307/2323060.
does this (generalises the codomain of a metric to a quite large class of sets with addition and order) and shows that "all" (I recall a talk on it that showed it for Tychonoff spaces, so it might not be really all) topological spaces can be thus endowed. 
There have been more of these efforts (some quite category-theoretical, others from computer science applications), but I don't have exact references there. This paper I've seen presented and your question reminded me of it. 
A: As already answered, Kopperman introduced (in "all topologies come from generalized metrics") the notion of a value semigroup and then defined a continuity space as a metric space (without symmetry or separation) taking values in a value semigroup. A semigroup consists as part of the definition of a subset of positive elements, and these are then used to define the induced topology. Every topological space arises in this way. The completely regular topologies are precisely those arising from a continuity spaces in which the metric is symmetric. Kopperman (in "First order topological axioms") discusses more separation axioms in this context. 
In a later article ("Quantales and continuity spaces") Flagg introduced the notion of value quantale, and uses them instead of value semigroups to define continuity spaces. Value quantales are quite different than value semigroups, and in a sense are stricter (i.e., have more structure). In particular, the notion of positive elements becomes internal. Flagg proves that every topological space is thus metrizable. In a note on the metrizability of spaces it is shown that this result extends to an equivalence of categories between $Top$ and the category of all Flagg continuity spaces and continuous functions. It is still true that the completely regular spaces are precisely those spaces which are symmetrically metrizable. 
