first steps for Dict.keys and Dict.values

This commit is contained in:
Folkert 2021-02-13 18:35:36 +01:00
parent 927ba11e64
commit 16143bc06e
7 changed files with 122 additions and 1 deletions

View file

@ -801,6 +801,24 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
),
);
// Dict.keys : Dict k v -> List k
add_type(
Symbol::DICT_KEYS,
top_level_function(
vec![dict_type(flex(TVAR1), flex(TVAR2))],
Box::new(list_type(flex(TVAR1))),
),
);
// Dict.values : Dict k v -> List v
add_type(
Symbol::DICT_KEYS,
top_level_function(
vec![dict_type(flex(TVAR1), flex(TVAR2))],
Box::new(list_type(flex(TVAR2))),
),
);
// Set module
// empty : Set a