# Topology/Space of Recursive Algebraic Datatypes

I have a recursive algebraic datatype. I (somewhat arbitrarily) defined one function to compute distance between instances, and am trying to define a function to approximate a "vector" between instances. I assume there's no single way to define a metric space on top of a definition of an algebraic data type, much less a vector space, but was wondering what literature exists about treating recursive algebraic datatypes as existing in a topological space with meaningful comparisons.

The reason I want to treat it like a vector space is because I want to define interpolation between two structures in some reasonable manner.

• What do you need these structures for? That might direct possible choices in a useful way. They yearning for vectors makes it look like you're secretly doing machine learning. Jul 31 '18 at 13:48
• Haha, I do come from something of a machine learning background, so maybe that shows through! Jul 31 '18 at 16:56