-
-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Labels
RFCNew specifications of ErgNew specifications of ErgenhancementNew feature or requestNew feature or request
Description
Currently, Erg doesn't have homogenous dict types.
dic: {Int: Str, Str: Float} = {1: "a", "b": 1.0}A dictionary with Str as keys and Int as values is simply of type {Str: Int}.
We can write key/values of different types, but sometimes this spec is too elastic (especially for mutable Dict types).
Therefore, we propose to introduce homogenous dict types Dict(K, V)/Dict!(K, V).
dic: Dict(Str, Int) = {"a": 1, "b": 2}The current heterogeneous dict types are kinds of structural types, just like record types, and are subtypes of the homogenous dict types. For example, {K1: V1, K2: V2} is a subtype of Dict(K1 or V1, K2 or V2).
Metadata
Metadata
Assignees
Labels
RFCNew specifications of ErgNew specifications of ErgenhancementNew feature or requestNew feature or request