Generalize message types to an I18n type that works for all types
#2
Conversation
|
This could be generalized even further as a product of Ts under a context/key K, without requiring to be <: String, so I'll have to revisit my previous work that was working around not having NotGiven. Also using ValueOf as a constraint on the keys to distinguish between the singletons and a union or intersection. |
|
I think that for Cosmopolite that "context" would always be a language. But you're right, the data structure could be useful in other contexts, and maybe it could be abstracted into a separate library. But I'd also be interested in representing the language as a type parameterized on a String singleton literal, rather than the String literal itself. This would tighten things up a little bit. |
|
Yes, it would rather be Other than that there is the mainstream argument of strong typing, but with this type level encoding that falls apart because you can control if a String is a part of a Set of languages, so then just a |
Cosmopolite currently only supports working with strings. This generalizes the
Messagestype to anI18ncontainer type which can handle any type.