Fresh Swift
  • About
  • Tags
Fresh Swift

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.

Posted on October 17, 2017

#phantomtype 
  • ← Previous Post
  • Next Post →

 •  2019  •  Fresh Swift

Hugo v0.20.7 powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo