Swift: Money with Phantom Types 👻

A parameterized type that does not actually appear at all in the definition of a generic type is known as a phantom type. Such a type is used simply to enforce compile time type checking, allowing us to encapsulate definitions, and guard against incorrect usage. In this post, Natasha Murashev looks at such phantom types, and demonstrates how they can be used.