

Making a Numeric Type in Swift - fcanas
http://www.fabiancanas.com/blog/2015/5/21/making-a-numeric-type-in-swift

======
Someone
Improvement: add multiplications "double times T" and "T times double" and
division "T divided by double", all returning T.

That allows you Tom for example, compute how far a return journey to a city at
Distance d is.

~~~
fcanas
There are many ways to continue to extend the `Distance` type, and many other
types that can be constructed in the same fashion. Each extension should be
considered in the context of the code base it's going to operate in. For
example, it's not difficult to create a new protocol, some generic functions
with type constraints, and end up with an `Area` type with a fully correct
relationship to `Distance`. I may write about such extensions as I continue to
explore this space.

