// The domain (aka "keyspace") enum TextAttributes {} struct FontSize : HeterogeneousDictionaryKey { typealias Domain = TextAttributes typealias Value = Double } struct Font : HeterogeneousDictionaryKey { typealias Domain = TextAttributes typealias Value = NSFont } struct ForegroundColor : HeterogeneousDictionaryKey { typealias Domain = TextAttributes typealias Value = NSColor } This is another parallel with the SwiftUI environment, which also uses types as keys (the public environment API uses key paths as keys, but you’ll see the types underneath if you ever define your own environment key). subscript < Key > ( key : Key .