mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
union and intersection
This commit is contained in:
parent
cbe91abcc2
commit
02db8f1a05
11 changed files with 579 additions and 1 deletions
|
@ -819,6 +819,42 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
),
|
||||
);
|
||||
|
||||
// Dict.union : Dict k v, Dict k v -> Dict k v
|
||||
add_type(
|
||||
Symbol::DICT_UNION,
|
||||
top_level_function(
|
||||
vec![
|
||||
dict_type(flex(TVAR1), flex(TVAR2)),
|
||||
dict_type(flex(TVAR1), flex(TVAR2)),
|
||||
],
|
||||
Box::new(dict_type(flex(TVAR1), flex(TVAR2))),
|
||||
),
|
||||
);
|
||||
|
||||
// Dict.intersection : Dict k v, Dict k v -> Dict k v
|
||||
add_type(
|
||||
Symbol::DICT_INTERSECTION,
|
||||
top_level_function(
|
||||
vec![
|
||||
dict_type(flex(TVAR1), flex(TVAR2)),
|
||||
dict_type(flex(TVAR1), flex(TVAR2)),
|
||||
],
|
||||
Box::new(dict_type(flex(TVAR1), flex(TVAR2))),
|
||||
),
|
||||
);
|
||||
|
||||
// Dict.difference : Dict k v, Dict k v -> Dict k v
|
||||
add_type(
|
||||
Symbol::DICT_DIFFERENCE,
|
||||
top_level_function(
|
||||
vec![
|
||||
dict_type(flex(TVAR1), flex(TVAR2)),
|
||||
dict_type(flex(TVAR1), flex(TVAR2)),
|
||||
],
|
||||
Box::new(dict_type(flex(TVAR1), flex(TVAR2))),
|
||||
),
|
||||
);
|
||||
|
||||
// Set module
|
||||
|
||||
// empty : Set a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue