As the Swift APIs have evolved, Apple has also been improving their own frameworks to make them easier to work with in Swift. Two API improvements I've personally appreciated are how we work with NSAttributedString keys, and Notification names.

Deriving inspiration from those additions, I thought UserDefaults could probably benefit from a similar approach.

Keys

Lets start by defining a UserDefaults.Key type similar to NSAttributedString.Key.